logon script is not working

Posted on 2009-02-18
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?
Question by:Thomas N
LVL 12

Expert Comment

ID: 23676074
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?
LVL 12

Expert Comment

ID: 23676098
Also, is the ..reg file located with the logon script?

Author Comment

by:Thomas N
ID: 23676126
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.

Expert Comment

ID: 23676227
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?

Accepted Solution

JustWorking earned 2000 total points
ID: 23676323
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


Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question