Posted September 15, 200915 yr 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, 200915 yr by Raoul
September 15, 200915 yr 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
September 16, 200915 yr Author 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.
September 16, 200915 yr 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.
September 26, 200915 yr try it like this..DEL /F /Q "%SYSTEMDRIVE%\users\Public\Desktop\QuickTime Player.lnk"edit.. ok
September 26, 200915 yr There's also the %Public% variable, that points to C:\Users\Public.DEL /F /Q "%Public%\Desktop\Shortcut.lnk"
September 27, 200915 yr 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
September 27, 200915 yr Author 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.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.