Lucius Snow Posted September 20, 2004 Posted September 20, 2004 Hello all,I included in my RunOnceEx.cmd a cleanup.cmd which add / delete some stuff. When it runs at the first logon of a new account, the cleanup seems to run before the new profile is completely created. Then, for example, the shortcuts in the Start Folder aren't there yet so they're not deleted. I read on the forum a few tips like adding a ping 127.0.0.1 -n 20 in the BATCH files, but it didn't solve the problem.Any suggestions ?Thanks.
evilvoice Posted September 20, 2004 Posted September 20, 2004 well, I have the same problem, like favorites and links folders arent created until I guess after runonceex has executed, I believe one way to accomplish what you are looking to do is at the end of your runonce, add a command to add your cleanup.cmd to runonce (this runs AFTER you are fully logged in, for example, ypager runs here)...Im not 100% sure how useful this is, but I guess if it works, cool.
Lucius Snow Posted September 20, 2004 Author Posted September 20, 2004 Until now, i added in my cleanup new commands to make a second RunOnceEx.cmd on the next reboot. But i need now to run another RunOnceEx.cmd to customize the softwares for my others profiles (like i explained it here.). In the stuff i programmed, things get too much complicated if i use two reboots as well ...
Lucius Snow Posted September 21, 2004 Author Posted September 21, 2004 well, I have the same problem, like favorites and links folders arent created until I guess after runonceex has executed, I believe one way to accomplish what you are looking to do is at the end of your runonce, add a command to add your cleanup.cmd to runonce (this runs AFTER you are fully logged in, for example, ypager runs here)...Im not 100% sure how useful this is, but I guess if it works, cool.I just tried this method but it didn't work. So i've done the same but with Run instead of RunOnce. Also i added a ping. Finally, i got it right like this.Accounts.cmd (i use it to configure softwares for others accounts)set tagfile=\WIN51for %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist "%%i:%tagfile%" set CDDRIVE=%%i:SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Configuration des logiciels" /fREG ADD %KEY%\001 /VE /D "Acrobat reader 6.01" /fREG ADD %KEY%\001 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\acrobat\Settings.reg" /fREG ADD %KEY%\002 /VE /D "Alcohol 120% 1.9.2.1705" /fREG ADD %KEY%\002 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\alcohol\settings.reg" /fREG ADD %KEY%\003 /VE /D "FTP expert 3.5" /fREG ADD %KEY%\003 /V 1 /D "%CDDRIVE%\$OEM$\$1\Apps\ftpexpert\settings.exe" /fREG ADD %KEY%\004 /VE /D "Virtualdub 1.5.4" /fREG ADD %KEY%\004 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\virtualdub\settings.reg" /fREG ADD %KEY%\005 /VE /D "Winamp pro 5.05" /fREG ADD %KEY%\005 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\winamp\settings.reg" /fREG ADD %KEY%\006 /VE /D "WinRAR 3.30" /fREG ADD %KEY%\006 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\winrar\settings.reg" /fREG ADD %KEY%\007 /VE /D "Spybot 1.3" /fREG ADD %KEY%\007 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\spybot\Settings.reg" /fREG ADD %KEY%\008 /VE /D "Pad 3.04" /fREG ADD %KEY%\008 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\pad\settings.reg" /fREG ADD %KEY%\009 /VE /D "Zone alarm pro 5.1.011" /fREG ADD %KEY%\009 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\ZAP\settings.reg" /fSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunREG ADD %KEY% /V Cleanup3 /D "%CDDRIVE%\$OEM$\$1\Config\Cleanup3.cmd" /fcleanup3.cmdcmdow @ /HID@echo offREM Délai de l'éxécutionping 127.0.0.1 -n 8REM Ajout et suppression de raccourcis dans la barre de lancement rapidedel c:\docume~1\%username%\applic~1\microsoft\intern~1\quickl~1\spy*.lnkcopy c:\docume~1\%username%\menudm~1\programmes\accessoires\explo*.lnk c:\docume~1\%username%\applic~1\microsoft\intern~1\quickl~1\REM Suppression de raccourcisdel /f /s /a C:\Docume~1\%username%\Bureau\*.lnkdel "%userprofile%\Menudm~1\Programmes\*.lnk"del C:\docume~1\defaul~1\Menudm~1\Programmes\*.lnkREM Suppression des fichiers temporairescd\cd \docume~1\%username%\locals~1rd /s /q Tempmd Tempcd\REM Nettoyage de la base de registrereg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Cleanup3 /fEXITThis line in bold deletes the entry in Run so the BATCH doesn't run anymore at startup.
MHz Posted September 21, 2004 Posted September 21, 2004 You could do it without another boot by making use of the startup folder.For example:Is my command file.$OEM$\$DOCS\All Users\Start Menu\Programs\Startup\xxxx.cmdIs my self-destruct command file, that runs at first logon.cmdow @ /hid@echo offdel "%userprofile%\start menu\programs\Internet Explorer.lnk"del "%userprofile%\start menu\programs\Outlook Express.lnk"move "%userprofile%\start menu\programs\Remote Assistance.lnk" "%allusersprofile%\start menu\programs\Accessories\Communications\Remote Assistance.lnk"attrib -r "%allusersprofile%\start menu\programs\startup\xxxx.cmd"attrib -r "%userprofile%\SciTEUser.properties"attrib -r "%systemroot%\SecAlert.exe""%systemroot%\SecAlert.exe"del "%systemroot%\SecAlert.exe"ShutDown.exe -s -t 10 -c "System shutdown required now. Thankyou for your patience."del "%allusersprofile%\start menu\programs\startup\xxxx.cmd"Saves me the hassle of another boot and gives me further options that the standard cleanup.cmd does not do. Like the shortcuts that are not created until you logon. SecAlert is an autoit file that takes care of some windows that open, etc.Hope this encourages you along with some ideas.
a06lp Posted September 21, 2004 Posted September 21, 2004 MHz...Nice idea! Putting a cleanup.cmd in All Users ...Startup, which deletes itself upon completion...are there any negative drawbacks to this method that I should know?Sounds like what I need (I am running WPI, and need cleanup to execute AFTER all the programs)... or is it?
MHz Posted September 21, 2004 Posted September 21, 2004 This executes upon first logon into desktop. It is the last action for my windows setup.Works good for me without any complications.I use an autoit file to wait for certain windows to popup and configure them.You could use sleep.exe to delay actions and whatever else.
a06lp Posted September 21, 2004 Posted September 21, 2004 have you ever used/seen WPI? It's here: http://www.msfn.org/board/index.php?showtopic=28125I want to know if this method will work as a cleanup AFTER WPI, (once everything is installed, i want to delete some shortcuts, and the C:\Install folder)
MHz Posted September 21, 2004 Posted September 21, 2004 have you ever used/seen WPI? It's here: http://www.msfn.org/board/index.php?showtopic=28125I want to know if this method will work as a cleanup AFTER WPI, (once everything is installed, i want to delete some shortcuts, and the C:\Install folder)I have not tried WPI. I would assume that it is a menu driven program for installers. You should be able to run this program from runonce or runonceex. It should finish it's actions before the command file in startup folder executes?If WPI does finish before desktop logon, it should be fine.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now