shyam pothini
asked on
how to run a batch file whenever user logs in for only one time
How to run a batch file one time for user.
that means I have a batch file to change registry keys and I want to run it when a user logs in and if the user logs in for second time it should not run.
But if another user logs in the batch file should run.
Is there any setting in registry like run or run once?
Thanks
that means I have a batch file to change registry keys and I want to run it when a user logs in and if the user logs in for second time it should not run.
But if another user logs in the batch file should run.
Is there any setting in registry like run or run once?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the responses
Its domain environment but we don't want to do it with group policy
but local group policies are ok
Please guide me how to do that.
Its domain environment but we don't want to do it with group policy
but local group policies are ok
Please guide me how to do that.
"We don't want to do it with group policy but local group policies are ok" - you need to tell why, because that sounds, well, crazy.
ASKER
It does for me too, I like doing through group policy.
But they say its corporate policy, not to use GPO's
But they say its corporate policy, not to use GPO's
But local GPO is ok?? It's the same thing, the very same thing. That makes no sense at all.
Ok, open gpedit.msc, navigate to user policy - windows settings - scripts - logon. There, link a batch.
Ok, open gpedit.msc, navigate to user policy - windows settings - scripts - logon. There, link a batch.
ASKER
Thanks
I kept the batch file in there.
But it run everytime user logs in. Is there any way I can run only one time for user
I kept the batch file in there.
But it run everytime user logs in. Is there any way I can run only one time for user
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
ASKER
If I create reg key name application and give the path where the file is
HKEY_CURRENT_USER\Software \Microsoft \Windows\C urrentVers ion\RunOnc e
it will run everytime user logs in right?
HKEY_CURRENT_USER\Software
it will run everytime user logs in right?
No, just once. MIcrosoft's article describes it:
By default, the value of a RunOnce key is deleted before the command line is run. You can prefix a RunOnce value name with an exclamation point (!) to defer deletion of the value until after the command runs. Without the exclamation point prefix, if the RunOnce operation fails the associated program will not be asked to run the next time you start the computer.
Open in new window