I want to have a set of dos commands run when windows starts for the first time. I tried a few things but none worked and I have searched on here a lot but have not found much documentation on RunOnce in nLite.
I want to run the command below, for example, on first boot into windows after install.
del C:\"Documents and Settings"\User\Desktop\*.lnk
This works when i put it in a batch or command file within windows. I tried calling it from the RunOnce area but it failed. I am not sure where i should locate the bat or cmd file with these commands in it within the nLite created image/directory.
Can someone please help or guide me to information.
Thanks
m00ty
Page 1 of 1
RunOnce and dos commands
#2
Posted 07 April 2009 - 06:05 PM
m00ty, if your are placing the command in the nLite RunOnce area, then the problem is that it runs at T-13. This is too early, since your account is not set up yet. There are many ways to accomplish this, but the easiest way may well be Windows Post Install (WPI, a couple forums below nLite's). It also allows you do many things such as installing programs. Enjoy, John.
#3
Posted 07 April 2009 - 06:35 PM
I think it has got to run in "RunOnceEx", not "RunOnce".
This is NOT at T-13, it runs when the User is logged on, but before Desktop has completly loaded.
This is NOT at T-13, it runs when the User is logged on, but before Desktop has completly loaded.
#4
Posted 09 April 2009 - 03:22 PM
it's located under i386, the file is NLITE.CMD, cabbed into NLITE.CM_
for your command, try with
del "C:\Documents and Settings\User\Desktop\*.lnk"
for your command, try with
del "C:\Documents and Settings\User\Desktop\*.lnk"
This post has been edited by mooms: 09 April 2009 - 03:23 PM
#5
Posted 10 April 2009 - 02:19 PM
Yes, that won't work as nLite's RunOnce operates before the desktop is fully loaded, you will need a command like this:
This will allow 2 minutes for the desktop to load (n-1 seconds, might need to increase if running GuiRunOnce commands) before scrubbing the desktop.
If that doesn't work go with:
Where CleanUp.bat is a batch file in the root directory of your install media containing:
Start CMD /R " Ping -n 121 127.0.0.1 > nul && Del "%UserProfile%\Desktop\*.lnk" && Del "%AllUsersProfile%\Desktop\*.lnk" "
This will allow 2 minutes for the desktop to load (n-1 seconds, might need to increase if running GuiRunOnce commands) before scrubbing the desktop.
If that doesn't work go with:
Start CMD /R %Source%CleanUp.bat
Where CleanUp.bat is a batch file in the root directory of your install media containing:
Ping -n 121 127.0.0.1 > nul Del "%UserProfile%\Desktop\*.lnk" Del "%AllUsersProfile%\Desktop\*.lnk"
This post has been edited by Kurt_Aust: 10 April 2009 - 03:41 PM
- ← Setting "My Computer icon" on top
- nLite
- slipstreamed my key with nlite, but it doesn't go unattended... →
Share this topic:
Page 1 of 1



Help
Back to top









