m00ty Posted April 7, 2009 Share Posted April 7, 2009 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\*.lnkThis 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.Thanksm00ty Link to comment Share on other sites More sharing options...
johnhc Posted April 8, 2009 Share Posted April 8, 2009 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. Link to comment Share on other sites More sharing options...
g-force Posted April 8, 2009 Share Posted April 8, 2009 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. Link to comment Share on other sites More sharing options...
mooms Posted April 9, 2009 Share Posted April 9, 2009 (edited) 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" Edited April 9, 2009 by mooms Link to comment Share on other sites More sharing options...
Kurt_Aust Posted April 10, 2009 Share Posted April 10, 2009 (edited) Yes, that won't work as nLite's RunOnce operates before the desktop is fully loaded, you will need a command like this: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.batWhere CleanUp.bat is a batch file in the root directory of your install media containing:Ping -n 121 127.0.0.1 > nulDel "%UserProfile%\Desktop\*.lnk"Del "%AllUsersProfile%\Desktop\*.lnk" Edited April 10, 2009 by Kurt_Aust Link to comment Share on other sites More sharing options...
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