Jump to content

Recommended Posts

Posted

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.


Posted

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.

Posted

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 :} ...

Posted
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=\WIN51

for %%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\RunOnceEx

REG ADD %KEY% /V TITLE /D "Configuration des logiciels" /f

REG ADD %KEY%\001 /VE /D "Acrobat reader 6.01" /f

REG ADD %KEY%\001 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\acrobat\Settings.reg" /f

REG ADD %KEY%\002 /VE /D "Alcohol 120% 1.9.2.1705" /f

REG ADD %KEY%\002 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\alcohol\settings.reg" /f

REG ADD %KEY%\003 /VE /D "FTP expert 3.5" /f

REG ADD %KEY%\003 /V 1 /D "%CDDRIVE%\$OEM$\$1\Apps\ftpexpert\settings.exe" /f

REG ADD %KEY%\004 /VE /D "Virtualdub 1.5.4" /f

REG ADD %KEY%\004 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\virtualdub\settings.reg" /f

REG ADD %KEY%\005 /VE /D "Winamp pro 5.05" /f

REG ADD %KEY%\005 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\winamp\settings.reg" /f

REG ADD %KEY%\006 /VE /D "WinRAR 3.30" /f

REG ADD %KEY%\006 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\winrar\settings.reg" /f

REG ADD %KEY%\007 /VE /D "Spybot 1.3" /f

REG ADD %KEY%\007 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\spybot\Settings.reg" /f

REG ADD %KEY%\008 /VE /D "Pad 3.04" /f

REG ADD %KEY%\008 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\pad\settings.reg" /f

REG ADD %KEY%\009 /VE /D "Zone alarm pro 5.1.011" /f

REG ADD %KEY%\009 /V 1 /D "regedit /s %CDDRIVE%\$OEM$\$1\Apps\ZAP\settings.reg" /f

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

REG ADD %KEY% /V Cleanup3 /D "%CDDRIVE%\$OEM$\$1\Config\Cleanup3.cmd" /f

cleanup3.cmd
cmdow @ /HID

@echo off

REM Délai de l'éxécution

ping 127.0.0.1 -n 8

REM Ajout et suppression de raccourcis dans la barre de lancement rapide

del c:\docume~1\%username%\applic~1\microsoft\intern~1\quickl~1\spy*.lnk

copy c:\docume~1\%username%\menudm~1\programmes\accessoires\explo*.lnk c:\docume~1\%username%\applic~1\microsoft\intern~1\quickl~1\

REM Suppression de raccourcis

del /f /s /a C:\Docume~1\%username%\Bureau\*.lnk

del "%userprofile%\Menudm~1\Programmes\*.lnk"

del C:\docume~1\defaul~1\Menudm~1\Programmes\*.lnk

REM Suppression des fichiers temporaires

cd\

cd \docume~1\%username%\locals~1

rd /s /q Temp

md Temp

cd\

REM Nettoyage de la base de registre

reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Cleanup3 /f

EXIT

This line in bold deletes the entry in Run so the BATCH doesn't run anymore at startup.

Posted

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.cmd

Is my self-destruct command file, that runs at first logon.

cmdow @ /hid
@echo off
del  "%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.

:)

Posted

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?

Posted

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.

:)

Posted
have you ever used/seen WPI? 

It's here: http://www.msfn.org/board/index.php?showtopic=28125

I 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.

:)

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...