Jump to content

Running logon script


Recommended Posts

I currently have all users authenticate to Linux box and run their logon script that is located on the Linux box this way:

XP Group Policy under logon scripts I have: \\servername\netlogon\joe.bat

works fine, but now I want to do this via Autoit script. example

dim $username = " "

$username = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName")

$username1 = StringLower($username)

Runwait("\\servername\netlogon\$username1" & ".bat", "", @SW_HIDE)

this would make it so I only need one script, but for some reason it will not run the script, but if I just put the users name (i.e. joe.bat) in the Runwait it works fine.

What am I missing?

Link to comment
Share on other sites

Try RunWait("\\servername\netlogon\" & $username1 & ".bat", "", @SW_HIDE)

I currently have all users authenticate to Linux box and run their logon script that is located on the Linux box this way:

XP Group Policy under logon scripts I have: \\servername\netlogon\joe.bat

works fine, but now I want to do this via Autoit script. example

dim $username = " "

$username = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName")

$username1 = StringLower($username)

Runwait("\\servername\netlogon\$username1" & ".bat", "", @SW_HIDE)

this would make it so I only need one script, but for some reason it will not run the script, but if I just put the users name (i.e. joe.bat) in the Runwait it works fine.

What am I missing?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...