Vista Del file from ALLUSERSPROFILE - Desktop

Microsoft Windows vista ultimate - 32-bi...
September 14, 2010 at 07:59:20
Specs: Windows Vista
Hello,
The following command is working fine in Windows XP, but won't work under Vista, any idea?

cmd.exe /C del /q "%ALLUSERSPROFILE%\desktop\xxxx.lnk"

It tells me: "Could Not Find C:\ProgramData\desktop\xxxx.lnk"

The following command works fine under Vista and under XP:
cmd.exe /C copy /y C:\temp\xxxxx.lnk "%ALLUSERSPROFILE%\desktop\xxxx.lnk"


See More: Vista Del file from ALLUSERSPROFILE - Desktop

Report •

#1
September 14, 2010 at 08:15:13
well the problem lies in %allusersprofile% this is not used variable is windows vista

cmd.exe /C del /q "<<%ALLUSERSPROFILE%>>\desktop\xxxx.lnk"

but try:

cmd.exe /C del /q "%userprofile%\desktop\xxxx.lnk"

Should work


Report •

#2
September 14, 2010 at 08:32:18
Well this would point to the folder of the current user's desktop, i need the all users desktop directory...

Report •

#3
September 14, 2010 at 11:38:37
mmm ur right
try:
cmd.exe /C del /q "default\desktop\xxxx.lnk"
by the way, default is a hidden folder but it'll work

Report •

Related Solutions

#4
September 15, 2010 at 10:57:07
On WinNT 6.X, %allusersprofile%\desktop should point to %public%\desktop, so your script should find the file. Is the script running elevated?

Report •

Ask Question