Link to home
Start Free TrialLog in
Avatar of mbudman
mbudmanFlag for Canada

asked on

Run script once using group policy

Hello,

I would like to run a script (or batch file) once (per user or computer, whichever is easier)) preferably using group policy.

The script is to delete a registry key and its subkeys.

The environment consists of Windows 7 client workstations connected to a Windows 2003 Active directory network.

I would like to delete this key once per computer

HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles

Can this be done? If so, how?

Thanks in advance.

Mark
Avatar of Gabriel Clifton
Gabriel Clifton
Flag of United States of America image

You could use group policy to write a registry key to add the script to runonce and have that policy apply and not get reapplied.
Avatar of mbudman

ASKER

The problem is that "runonce" is not executed when someone connects to network via VPN.

All I would like to do is run delete a registry key once per computer.

The registry key in question contains the configuration information for a particular program. If the key is deleted (or does not exist), the program automatically runs the set up wizard, which is what I want to happen.

However, I do not want the set up wizard to run all the time - just once per computer.
Ok, I am really not familiar with networks via VPN so do scheduled tasks work across the VPN? If so then use group policy to create a scheduled task that executes once.
ASKER CERTIFIED SOLUTION
Avatar of Neeraj Kumar
Neeraj Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mbudman

ASKER

Thank you for your assistance.