Tekforums

Chat => Entertainment & Technology => Topic started by: Pete on March 27, 2007, 19:05:26 PM

Title: Run once
Post by: Pete on March 27, 2007, 19:05:26 PM
I want a c:\batchfile.bat to run on a users first login and then not run on subsequent logins. I think the term is "run once" but I dunno.
Title: Run once
Post by: bear on March 27, 2007, 19:50:21 PM
Does it help to put the batch here ? :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
Title: Re:Run once
Post by: Pete on March 27, 2007, 20:14:20 PM
Thanks, dont work though :(

Ive got:

c:\test.bat

and

test.reg, which is

HKLM,Software\Microsoft\Windows\CurrentVersion\RunOnce,"SilentApp",,"c:\test.bat"

but I get:

QuoteThe specified file is not a registry script.You can only import binary files from within the registry editor

Still missing something :(

Ah! need [  ] brackets :D  

edit:

hmmm, it went into the registry ok, but the batchfile didnt run  :?


Woo!

QuoteWindows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\zz170]

@="Mapped Drives"

"1"="test.bat"



Works :)