logon script is not working

Posted on 2009-02-18
Last Modified: 2013-11-10
I wrote a VBS script below:

set wshshell=createObject("")
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

    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

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

    Author Comment

    by:Thomas N
    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.
    LVL 6

    Expert Comment

    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?
    LVL 8

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
    This article will show, step by step, how to integrate R code into a R Sweave document
    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 …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now