SergeiK Posted October 17, 2011 Share Posted October 17, 2011 Dear Script Experts, Please, assist me to make the below code running.. I would like to run some app by logon script from the nearest domain controller, but fail. If I specify a domain cotroller explicitly - it works fine, but this code "@LogonServer & "\NETLOGON\PC\H\go.exe"" does not work... Thanks in advance!! $UserID = "XXX";$Password = "XXX";RunAs ($UserID,@LogonDomain,$Password,0, @LogonServer & "\NETLOGON\PC\H\go.exe"); Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 17, 2011 Share Posted October 17, 2011 Hi and Welcome to the forums!! Maybe @LogonServer isn't what you think it is? Have you made sure? You could show it with a MsgBox() or ConsoleWrite() (shows at the bottom of SciTE). Example: MsgBox(0, "", @LogonServer & "\NETLOGON\PC\H\go.exe") .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
SergeiK Posted October 17, 2011 Author Share Posted October 17, 2011 Thanks a lot for your reply!! Yes, this is what I need (verified): \\%logonserver%\NETLOGON\PC\H\go.exe. But the problem remains.. Kind regards, Sergei Link to comment Share on other sites More sharing options...
AdamUL Posted October 17, 2011 Share Posted October 17, 2011 Look at DriveMapAdd, it should do what you need. For Example:DriveMapAdd("", "\\" & @LogonServer & "\NETLOGON\PC\H", 0, @LogonDomain & "\" & $UserID, $Password) Adam Link to comment Share on other sites More sharing options...
martin Posted October 17, 2011 Share Posted October 17, 2011 Does @LogonServer contain a space perhaps? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
SergeiK Posted October 28, 2011 Author Share Posted October 28, 2011 Hello to All, Thanks - I have worked around the issue myselft. The problem was with windows variables when you use runas... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now