We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


logon script is not working

Medium Priority
Last Modified: 2013-11-10
I wrote a VBS script below:

set wshshell=createObject("wscript.shell")
wshShell.Run("RegEdit /s " & "RoamingProfile.reg")

To run this reg file:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
"ExcludeProfileDirs"="Local Settings\\Temporary Internet Files;Local Settings\\History;Local Settings\\Temp"

Its to remove this registry entry so that roaming profiles will move the Outlook folder. I put it in the logon script section for group policy but it does not run. If I run it on the local machine it works. Is there something I need to change in the script since it is going through group policy and loading off a server instead of just clicking and running from the local machine?
Watch Question

HI There
Other than use VBscript to actually write thos keys into the registry, you could also make use of this area in the GPO
'User Config\Admin Templates\System\Logon\Run these programs at user logon'

See if that helps?

Also, is the ..reg file located with the logon script?
Thomas NSystems Analyst - Windows System Administrator


Yes, Its in the same folder as the logon script. I also added an additional rule under software restrictions in the GPO to give users unrestricted access to the folder where the script is at.
could it be easier to just use REG DELETE /F HKLM\Software\Windows\CurrentVersion\Etc instead of writing a VBS script that merges a REG file?
You might try calling regedit.exe in your vb
Dim Shell
Set Shell = CreateObject("WScript.Shell")
shell.Run "C:\windows\regedit.exe /s \\server\yourshare\RoamingProfile.reg"

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.