tkmadison Posted January 3, 2006 Posted January 3, 2006 Generally, I use RunOnceEx to install all my applications and this works just fine for me.However, at the end of ROE, I have had it run a batch command to clean up shortcuts, rearrange my start menu, and things like that. Now it has no problem handling %AllUserProfile%, but when it comes to just vanilla %UserProfile%, it can't do it since the user account hasn't been logged into yet. (I have a user account created via oobe, and that works just fine).My question is, is it possible to have a batch command run at the end of ROE that enters in a second RunOnceEx command to run at next startup which would take care of the rest of my cleanup, or is there some simpler way to go about it?
codeblue Posted January 3, 2006 Posted January 3, 2006 The way i get arround this problem is to have a self deleting .cmd file copied into the Startup folder during install. This way it will only run once the %userprofile% is created. Its not the best way but its the only way i could find that works.The only issue i have is i want the Startup folder to be hidden and i think this interfears with this.
tkmadison Posted January 3, 2006 Author Posted January 3, 2006 The way i get arround this problem is to have a self deleting .cmd file copied into the Startup folder during install. This way it will only run once the %userprofile% is created. Its not the best way but its the only way i could find that works.The only issue i have is i want the Startup folder to be hidden and i think this interfears with this.Interesting approach.I wouldn't mind seeing your code.
gunsmokingman Posted January 3, 2006 Posted January 3, 2006 Try this add this to the end of your RunOnceEx.cmdSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\170 /VE /D "Preparing Final Clean Up ..." /fREG ADD %KEY%\170 /V 1 /D "%systemdrive%\Install\cleanup.cmd" /fThis will run the cleanup.cmd after you have finished installing app andhave rebooted.
druiddk Posted January 3, 2006 Posted January 3, 2006 I have a firstlogin.cmd script i use and then in the end of firstlogin.cmd i remove it again:call del "%AllUsersProfile%\Menuen Start\Programmer\Start\firstlogin.cmd"
Noise Posted January 3, 2006 Posted January 3, 2006 If the user profile hasn't been created yet, then use the Default User profile. I specify the directory thusly:%AllUserProfile%\..\Default User
tkmadison Posted January 3, 2006 Author Posted January 3, 2006 Try this add this to the end of your RunOnceEx.cmdSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\170 /VE /D "Preparing Final Clean Up ..." /fREG ADD %KEY%\170 /V 1 /D "%systemdrive%\Install\cleanup.cmd" /fThis will run the cleanup.cmd after you have finished installing app andhave rebooted.Ok, so if I have a small batch at the end of my ROE that is simply a reboot command, I can add this code as is and it will add my cleanup.cmd to ROE?Sounds good. I'll have to give it a try.
MAVERICKS CHOICE Posted January 4, 2006 Posted January 4, 2006 (edited) Or as mentioned use two ROE & reboot between first & second ROE. In the second ROE after all apps are installed call your batch with all the cleanup stuff you need.I have been doin similar for quite a while & working well.CheersMC. Edited January 4, 2006 by MAVERICKS CHOICE
gunsmokingman Posted January 4, 2006 Posted January 4, 2006 Try this add this to the end of your RunOnceEx.cmdSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\170 /VE /D "Preparing Final Clean Up ..." /fREG ADD %KEY%\170 /V 1 /D "%systemdrive%\Install\cleanup.cmd" /fThis will run the cleanup.cmd after you have finished installing app andhave rebooted.Ok, so if I have a small batch at the end of my ROE that is simply a reboot command, I can add this code as is and it will add my cleanup.cmd to ROE?Sounds good. I'll have to give it a try.As long as you have the cmd in this location %systemdrive%\Install\cleanup.cmd then it will runafter the reboot
tkmadison Posted January 4, 2006 Author Posted January 4, 2006 As long as you have the cmd in this location %systemdrive%\Install\cleanup.cmd then it will runafter the rebootAlright, I'm going to try something along those lines...here's what i've got...REG ADD %KEY%\086 /VE /D "Rebooting..." /fREG ADD %KEY%\086 /V 1 /D "%PP%\folder.exe" /fREG ADD %KEY%\086 /V 2 /D "%PP%\reboot.cmd" /fSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\090 /VE /D "Preparing Final Clean Up ..." /fREG ADD %KEY%\090 /V 1 /D "%systemdrive%\cleanup.cmd" /fEXITThe second line is a simply a little SetupFactory program I made to change the location of My Documents.I made a simple reboot batch to reboot automatically after 60 seconds. However, I'm concerned that the second ROE won't be entered into the registry until the reboot batch is completed, which wouldn't work, would it?My reboot.cmd code:cmdow @ /HIDshutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."EXITProbably a simpler way to do that, as well.
MAVERICKS CHOICE Posted January 4, 2006 Posted January 4, 2006 As long as you have the cmd in this location %systemdrive%\Install\cleanup.cmd then it will runafter the rebootAlright, I'm going to try something along those lines...here's what i've got...REG ADD %KEY%\086 /VE /D "Rebooting..." /fREG ADD %KEY%\086 /V 1 /D "%PP%\folder.exe" /fREG ADD %KEY%\086 /V 2 /D "%PP%\reboot.cmd" /fSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\090 /VE /D "Preparing Final Clean Up ..." /fREG ADD %KEY%\090 /V 1 /D "%systemdrive%\cleanup.cmd" /fEXITThe second line is a simply a little SetupFactory program I made to change the location of My Documents.I made a simple reboot batch to reboot automatically after 60 seconds. However, I'm concerned that the second ROE won't be entered into the registry until the reboot batch is completed, which wouldn't work, would it?My reboot.cmd code:cmdow @ /HIDshutdown.exe -r -f -t 60 -c "Windows XP will now restart in 1 minute..."EXITProbably a simpler way to do that, as well.Should work give it a whirl. I do mine a little differently with three seperate ROE's heres an example.REG ADD %KEY%\220 /VE /D "Loading Programs Volume Three Please wait" /fREG ADD %KEY%\220 /V 1 /D "%CDROM%\Software\Runonce\Runonceex2.cmd" /fREG ADD %KEY%\223 /VE /D "The Machine Will Reboot in Ten Seconds" /fREG ADD %KEY%\223 /V 1 /D "%CDROM%\Software\Reboot.cmd" /fWorks for me.CheersMC.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now