• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 751
  • Last Modified:

Windows 7 User Logon and Logoff Scripts

I added login and logoff scripts under the Local Group Policy Editor, User Configuration, Windows Settings, Scripts.  The scripts reside in the root of the C drive.   The scripts dont seem to be working.  When I click on "To view the Script Files stores in this Group Policy Object", nothing appears.

This is a normal script, no a Powershell script.

I googled something about having to activate the Powershell Script feature.  Do I also need to activate the normal script feature?    Thanks!

0
jscns
Asked:
jscns
  • 4
  • 4
1 Solution
 
howejustinCommented:
Put the scripts in your System32 folder and see how that works for you (or add the root of C to your system path locations). I presume that in order to execute and call/see those scripts, it's looking in any of the pre-defined path locations (of which System32 is in by default).
0
 
RobSampsonCommented:
If you are using Group Policy, put the scripts in the folder
\\domain.com\sysvol\domain.com\scripts

or simply
\\yourdc\netlogon

Then just put the filename only in the script box to run.

Rob.
0
 
jscnsAuthor Commented:
Can sometime please answer my question and tell me if I need to do anything to active the script feature in Windows 7?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
RobSampsonCommented:
No, for VBS scripts, (and even Powershell for Windows 7), there's nothing you need to do, besides point the Group Policy to the correct script location.  Usually, for Active Directory, scripts go into the Netlogon share of your Domain Controllers, and then in the Scripts dialog box where you enter the script, you just need to put its name, and not the path.

Regards,

Rob.
0
 
jscnsAuthor Commented:
I am running Windows 7 Professional.  Can you provide me with directions on how to "point the Group Policy to the correct script location'" ?  I have attached the directions for setting up the script.  Please see  page 4, step11 ...this is what I am trying to set up.    I dont know what Active Directory, Domain Controller, and Netlogin is......and I really dont need to ...just want to verify the script is working....I am unable to the dual screen feature to work.
Multi-Monitor-Setup-Guide--V4--2.pdf
0
 
RobSampsonCommented:
OK, my apologies.  I thought you were using Active Directory Group Policy, not local group policy.

Your scripts for logon should be copied to
C:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon

and for logoff they should go to
C:\WINDOWS\System32\GroupPolicy\User\Scripts\Logoff

Then, when you click Show Files in the dialog, it will be displayed.  Then you can just put the script name, not the path, and it should run fine.

Regards,

Rob.
0
 
jscnsAuthor Commented:
I will do that.  However, I am wondering why the attached instructions tell me to put the script in the root of the C drive?  Any thoughts?
0
 
RobSampsonCommented:
I just tested it on Win7 32bit, by placing a script in C:\Temp\Test.vbs and then entering the full path in the Scripts dialog, and when I logged on, it ran fine.  How are you sure it's not running?  The Show Files button will only show files in the C:\WINDOWS\System32\GroupPolicy\User\Scripts\Logon folder.

If you test this script, it will write a file in the same folder you place the script, called Test.txt, and write "Hi" to it, when you log in.

Regards,

Rob.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "Test.txt")
objFile.WriteLine "Hi"
objFile.Close

Open in new window

0
 
jscnsAuthor Commented:
Thank you!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now