Raoul Posted September 15, 2009 Share Posted September 15, 2009 (edited) Hey,I cant figure out how to delete some icons from the desktop:DEL /S /F /Q "%UserProfile%\Bureaublad\VLC media player.lnk"DEL /S /F /Q "%UserProfile%\Bureaublad\QuickTime Player.lnk"DEL /S /F /Q "%UserProfile%\Bureaublad\Malwarebytes' Anti-Malware.lnk"DEL /S /F /Q "%UserProfile%\Bureaublad\Adobe Reader 9.lnk"DEL /S /F /Q "%AllUsersProfile%\Bureaublad\Adobe Reader 9.lnk"DEL /S /F /Q "%AllUsersProfile%\Bureaublad\Malwarebytes' Anti-Malware.lnk"DEL /S /F /Q "%AllUsersProfile%\Bureaublad\QuickTime Player.lnk"DEL /S /F /Q "%AllUsersProfile%\Bureaublad\VLC media player.lnk"DEL /S /F /Q "%AllUsersProfile%\Desktop\Adobe Reader 9.lnk"DEL /S /F /Q "%AllUsersProfile%\Desktop\Malwarebytes' Anti-Malware.lnk"DEL /S /F /Q "%AllUsersProfile%\Desktop\QuickTime Player.lnk"DEL /S /F /Q "%AllUsersProfile%\Desktop\VLC media player.lnk"DEL /S /F /Q "%UserProfile%\Desktop\VLC media player.lnk"DEL /S /F /Q "%UserProfile%\Desktop\QuickTime Player.lnk"DEL /S /F /Q "%UserProfile%\Desktop\Malwarebytes' Anti-Malware.lnk"DEL /S /F /Q "%UserProfile%\Desktop\Adobe Reader 9.lnk"Thats what I tried, I also tried just DEL without switches, but it aint working.I tried Desktop (ENU) and Bureaublad (NL), I am using NL Windows 7.Maybee an other way, making addon that deletes them or.. ? Edited September 15, 2009 by Raoul Quote Link to comment Share on other sites More sharing options...
bober Posted September 15, 2009 Share Posted September 15, 2009 looks like you might no be admin, try removing @echo off and putting a pause at the end to see what error is returned.also why not do:cleanup.batDEL /F /Q "%UserProfile%\Bureaublad\*.lnk"DEL /F /Q "%AllUsersProfile%\Bureaublad\*.lnk"DEL /F /Q "%systemdrive%\Users\Public\Bureaublad\*.lnk" note that i have removed the /s switch as you are giving it the full path thus dosent need to erase in any sub dir.Plus i added the 3rd line as its a new desktop path that is kinda like allusers/desktop.And remember ure batch file will ahve to be run as admin.if ure running the batch as part of an automation then ull ahve to provide a user name which is an admin and call the "cleanup.bat" or what ever ure going to name it.runpromoted.batrunas /user:SOMEADMIN /savecred cleanup.batyou will have to enter the name of the admin account of the pc here > SOMEADMINalso the "/savecred" switch is optional, it keeps you from having to re-enter the account password a 2nd time if the batch is ran later.if its being ran from a cd then ull have to change it like so:SET CDROM=%~d0runas /user:SOMEADMIN /savecred %CDROM%\cleanup.bat Quote Link to comment Share on other sites More sharing options...
Raoul Posted September 16, 2009 Author Share Posted September 16, 2009 I run it from FirstLogonCommand in Autounattended.xml.But I dont want to remove all icons, just the ones I pointed out, so not the *.lnk.Will try it with the PAuse, to find out the error. Quote Link to comment Share on other sites More sharing options...
bober Posted September 16, 2009 Share Posted September 16, 2009 I run it from FirstLogonCommand in Autounattended.xml.But I dont want to remove all icons, just the ones I pointed out, so not the *.lnk.Will try it with the PAuse, to find out the error.ok, but i am prety sure its cause of admin privileges. Quote Link to comment Share on other sites More sharing options...
Raoul Posted September 26, 2009 Author Share Posted September 26, 2009 (edited) Works fine now, thanks. Edited September 26, 2009 by Raoul Quote Link to comment Share on other sites More sharing options...
Fixit Posted September 26, 2009 Share Posted September 26, 2009 try it like this..DEL /F /Q "%SYSTEMDRIVE%\users\Public\Desktop\QuickTime Player.lnk"edit.. ok Quote Link to comment Share on other sites More sharing options...
Stefhan Posted September 26, 2009 Share Posted September 26, 2009 There's also the %Public% variable, that points to C:\Users\Public.DEL /F /Q "%Public%\Desktop\Shortcut.lnk" Quote Link to comment Share on other sites More sharing options...
Guest Posted September 27, 2009 Share Posted September 27, 2009 Hi Raoul Please use this scriptI Found On The Msfn That Is Move All Shorcut From Desktop To other FolderThis Script Moving All Shortcut To 333CleanUpShortCuts.rar Quote Link to comment Share on other sites More sharing options...
Raoul Posted September 27, 2009 Author Share Posted September 27, 2009 Thanks but I dont want to delete all of the icons.Just did this:DEL /F /Q "%UserProfile%\Bureaublad\VLC media player.lnk"DEL /F /Q "%UserProfile%\Bureaublad\QuickTime Player.lnk"DEL /F /Q "%UserProfile%\Bureaublad\Malwarebytes' Anti-Malware.lnk"DEL /F /Q "%UserProfile%\Bureaublad\Adobe Reader 9.lnk"DEL /F /Q "%AllUsersProfile%\Bureaublad\Adobe Reader 9.lnk"DEL /F /Q "%AllUsersProfile%\Bureaublad\Malwarebytes' Anti-Malware.lnk"DEL /F /Q "%AllUsersProfile%\Bureaublad\QuickTime Player.lnk"DEL /F /Q "%AllUsersProfile%\Bureaublad\VLC media player.lnk"DEL /F /Q "%AllUsersProfile%\Desktop\Adobe Reader 9.lnk"DEL /F /Q "%AllUsersProfile%\Desktop\Malwarebytes' Anti-Malware.lnk"DEL /F /Q "%AllUsersProfile%\Desktop\QuickTime Player.lnk"DEL /F /Q "%AllUsersProfile%\Desktop\VLC media player.lnk"DEL /F /Q "%UserProfile%\Desktop\VLC media player.lnk"DEL /F /Q "%UserProfile%\Desktop\QuickTime Player.lnk"DEL /F /Q "%UserProfile%\Desktop\Malwarebytes' Anti-Malware.lnk"DEL /F /Q "%UserProfile%\Desktop\Adobe Reader 9.lnk"DEL /F /Q "%systemdrive%\Users\Public\Bureaublad\VLC media player.lnk"DEL /F /Q "%systemdrive%\Users\Public\Bureaublad\QuickTime Player.lnk"DEL /F /Q "%systemdrive%\Users\Public\Bureaublad\Malwarebytes' Anti-Malware.lnk"DEL /F /Q "%systemdrive%\Users\Public\Bureaublad\Adobe Reader 9.lnk"DEL /F /Q "%systemdrive%\Users\Public\Desktop\VLC media player.lnk"DEL /F /Q "%systemdrive%\Users\Public\Desktop\QuickTime Player.lnk"DEL /F /Q "%systemdrive%\Users\Public\Desktop\Malwarebytes' Anti-Malware.lnk"DEL /F /Q "%systemdrive%\Users\Public\Desktop\Adobe Reader 9.lnk"One of them did the job. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.