MSFN Forum: RunOnce and dos commands - MSFN Forum

Jump to content



If you are having issues with Windows after removing components and have come to ask for help, please attach (not paste) your Last Session.ini file to your post to facilitate quicker assistance.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

RunOnce and dos commands Rate Topic: -----

#1 User is offline   m00ty 

  • Group: Members
  • Posts: 1
  • Joined: 29-March 09

Posted 07 April 2009 - 03:56 PM

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


#2 User is offline   johnhc 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,246
  • Joined: 02-March 08
  • OS:Windows 7 x64
  • Country: Country Flag

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 User is offline   g-force 

  • Tester
  • PipPipPipPip
  • Group: Members
  • Posts: 596
  • Joined: 20-June 07
  • OS:XP Pro x86
  • Country: Country Flag

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.

#4 User is offline   mooms 

  • What ?
  • PipPip
  • Group: Members
  • Posts: 247
  • Joined: 13-October 07

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"

This post has been edited by mooms: 09 April 2009 - 03:23 PM


#5 User is offline   Kurt_Aust 

  • Master of trial, error & Google
  • PipPipPip
  • Group: Members
  • Posts: 447
  • Joined: 26-April 07

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:

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


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy