# Run Batch File once



## Spacecowboy2005 (Oct 2, 2008)

Hi!
I've created a batch file that will delete a certain file of every local machine.
However what i need to do is deploy this so that it will only ever run once per machine. So that the file is removed.
Can anyone offer any advice as how to do this?

Thanks for your help


----------



## -Fabez- (Jul 28, 2008)

You can use the RunOnce registry key.


----------



## Spacecowboy2005 (Oct 2, 2008)

Thanks Fabez, although i'm really sure how I'd go about deploying this.
Ideally I'd get the script to run at logon as part of a one off login script.
If you can offer some more detailed advice I'd be greatful.

Thanks


----------



## -Fabez- (Jul 28, 2008)

You would create the script that would delete the file, then add the script to the RunOnce registry key, using a .Reg file for instance.


----------

