Jump to content

Clenup.cmd icon deletion issues.


Recommended Posts


Well, the line in my .cmd says

DEL "%AllUsersProfile%\desktop\*.lnk"

However some icons are made at first login and rent deleted. How can i fix this.

BTW, this is ran via runonce.

You could set this command in an other batch file, that is triggered in the main_batch file that you run at GUIRUNONCE.

But make sure that you use a program that sleeps te batch file for a few seconds (sleep.exe) does the trick.

This is to make sure the system is completely booted and wrote all the dir's and files..

Hope this will help you

Link to comment
Share on other sites

Well, the line in my .cmd says

DEL "%AllUsersProfile%\desktop\*.lnk"

However some icons are made at first login and rent deleted. How can i fix this.

BTW, this is ran via runonce.

Is that HKLM Runonce or HKCU RunOnce. Or do you actually run it from HKLM RunOnceEx, like alot of people seem to do?

These 3 registry keys run at different times and have different characteristics. HKCU RunOnce runs when the desktop is active and that is when I run a script to cleanup shortcuts...

Edited by MHz
Link to comment
Share on other sites

For those harda$$ lnks don't want to disappear just simply add then to a .cmd file and run it as last thing Cleanup.cmd runs

My zzCleaningUp.cmd

Color 0A

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "UnattendXP - Cleaning Up Links" /f

REM //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

REG ADD %KEY%\DelShrtCuts /VE /D "Cleanup" /f

REG ADD %KEY%\DelShrtCuts /V 1 /D "CMD /C DEL \"%USERPROFILE%\Application Data\Microsoft\Internet Explorer\Quick Launch\Ad-Aware SE Personal.lnk\"" /f

REG ADD %KEY%\DelShrtCuts /V 2 /D "CMD /C DEL \"%USERPROFILE%\Application Data\Microsoft\Internet Explorer\Quick Launch\IncrediMail.lnk\"" /f

REG ADD %KEY%\DelShrtCuts /V 3 /D "CMD /C DEL \"%USERPROFILE%\Start Menu\Programs\Startup\Winamp Agent.lnk\"" /f

REG ADD %KEY%\DelShrtCuts /V 4 /D "CMD /C DEL \"%USERPROFILE%\Desktop\Winamp.lnk"" /f

REG ADD %KEY%\DelShrtCuts /V 1 /D "CMD /C DEL \"%USERPROFILE%\Application Data\Microsoft\Internet Explorer\Quick Launch\Winamp.lnk\"" /f

rundll32.exe iernonce.dll,RunOnceExProcess

EXIT

Been there and done that and so this file takes care of them but you name them separately

Give it a try

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...