1.

Solve : Help with this script please?

Answer»

I'm trying to GET the desktop shortcut that contains the url of alldata to be deleted. The SCRIPT locates the file, but for some reason doesn't delete it. Please help!

Script:
@echo
for /f "tokens=* delims=" %%i in ('dir /a:-d /b /s "%userprofile%\desktop\*.url"') do (
findstr /m /i "alldata" "%%i"
if not errorlevel 1 del %%i
)


Result:
C:\Documents and Settings\user.TSXP\Desktop>(
findstr /m /i "alldata" "C:\Documents and Settings\user.TSXP\desktop\MyALLDATA -
24-7 Self-Help Articles & Videos.url"
if not errorlevel 1 del C:\Documents and Settings\user.TSXP\desktop\MyALLDATA -
24-7 Self-Help Articles & Videos.url
)
C:\Documents and Settings\user.TSXP\desktop\MyALLDATA - 24-7 Self-Help Articles
& Videos.url
The SYSTEM cannot find the path specified.

C:\Documents and Settings\user.TSXP\Desktop>(
findstr /m /i "alldata" "C:\Documents and Settings\user.TSXP\desktop\Repair - Lo
gin.url"
if not errorlevel 1 del C:\Documents and Settings\user.TSXP\desktop\Repair - Lo
gin.url
)
C:\Documents and Settings\user.TSXP\desktop\Repair - Login.url
The system cannot find the path specified.I actually fixed it, just needed quotes around the last %%i.You have participated in the NEW COMPUTER Hope
Subliminal Stimuli assistant.



Discussion

No Comment Found