Cut and paste or wrap error on my last response....... :end needs to be on it's own line.
> if exist c:\runonce.txt goto end > echo %date% %time% >> c:\runonce.txt > <insert the commands for you real script here> > :end > -----Original Message----- > From: Kennedy, Jim [mailto:[EMAIL PROTECTED] > Sent: Friday, April 18, 2008 11:03 AM > To: NT System Admin Issues > Subject: RE: How does one schedule a command to run once on system > startup? > > There may be an easier way, but a GPO applied machine bat file with an > 'if exist' in it. I use this to reregister computers in WSUS a few > times a year. > > if exist c:\runonce.txt goto end > echo %date% %time% >> c:\runonce.txt > <insert the commands for you real script here> > :end > > So first time it starts up runonce.txt does not exist, so it creates > it, stamps when it did so and then runs your commands. Next time it > just goes to 'end'. > > > > > > -----Original Message----- > > From: John [mailto:[EMAIL PROTECTED] > > Sent: Friday, April 18, 2008 10:52 AM > > To: NT System Admin Issues > > Subject: How does one schedule a command to run once on system > startup? > > > > Hi all, > > > > I want to create a script that will run once the next time the server > > is restarted. I thought you could add the script under the > > HKLM\...\RunOnce registry key, but entries created under that key run > > on next login - not restart. I've also looked into creating a > > scheduled task to run "onstart" but can't figure how to get it to run > > "onstart" and only "once." Any ideas? > > > > Thanks in advance!! > > ~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~ > > ~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~ > > ~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~ > ~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~ ~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~ ~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~
