Jump to content

RunOnce and dos commands


m00ty

Recommended Posts

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

Link to comment
Share on other sites


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

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 by mooms
Link to comment
Share on other sites

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

Edited by Kurt_Aust
Link to comment
Share on other sites

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