简体   繁体   中英

Run Two Command Line Commands on Shutdown Group Policy

I am trying to run the following commands on start up for particular computers in a particular OU:

del "file_destination"  
REG ADD "registry_key" /v "value" /d "" /f 

I created a batch file with the above commands, but I do not know if the batch file can run with the Group Policy shutdown feature.

When I run the .bat file manually, the commands do not complete due to permissions, but if I run the batch file as an administrator it opens and closes automatically with no sign of completion.

I just need to remove the same file and replace the same registry key on multiple computers in my domain; it does not need to be a batch file. Please assist. Thank you!

Thank you @mojo for your consistent assistance.

The Batch script from the OP worked just fine.

I complicated the issue by trying to run the batch myself.

Probably due to security settings I could not get the batch itself to run as intended by right clicking and selecting "Run as Administrator".

But once I copied the file into the domain*\\shutdown directory the script ran just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM