rikho Posted January 26, 2010 Share Posted January 26, 2010 Hi all, this RunAsSet as disapear...? This is my old code, i need to translate it to launch my program with another user. with 3.3.4.0 i got an error on compilation to RunAsSet call... -> unknown function...(strange) is someone can explain to me, why, i will be less idiot tomorrow Regards Rikho expandcollapse popup#include <GUIConstants.au3> #include <Array.au3> #Region $Form1 = GUICreate("ActiveDirectory_usertool_v0.1", 282, 108, 193, 125) $Combo1 = GUICtrlCreateCombo("Selection", 80, 40, 121, 125) GUICtrlSetData(-1, "DOMAIN1|DOMAIN2|DOMAIN3") $Label1 = GUICtrlCreateLabel("Plz select a domain", 8, 8, 268, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Run", 72, 64, 137, 33, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 launch() EndSwitch WEnd func launch() ;~ if $cmdLine[0] > 0 then ;~ $domain = $cmdLine[1] ;~ else ;~ msgbox( $domain = GUICtrlRead($Combo1) If $domain = 'DOMAIN1' Then RunAsSet('%username%', '%domain%', '%password%', 2) Run(@ScriptDir & '\ActiveDirectory_usertool_v0.1.exe %selected_domain%', "", @SW_MAXIMIZE) Else MsgBox(4096, '', "Wrong domain", 10000) EndIf EndFunc Link to comment Share on other sites More sharing options...
Danny35d Posted January 26, 2010 Share Posted January 26, 2010 (edited) In the latest Autoit is called RunAs ------> LinkChangeIf $domain = 'DOMAIN1' Then RunAsSet('%username%', '%domain%', '%password%', 2) Run(@ScriptDir & '\ActiveDirectory_usertool_v0.1.exe %selected_domain%', "", @SW_MAXIMIZE) Else MsgBox(4096, '', "Wrong domain", 10000) EndIfToIf $domain = 'DOMAIN1' Then RunAs('%username%', '%domain%', '%password%', 2, @ScriptDir & '\ActiveDirectory_usertool_v0.1.exe %selected_domain%', "", @SW_MAXIMIZE) Else MsgBox(4096, '', "Wrong domain", 10000) EndIf Edited January 26, 2010 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
rikho Posted January 26, 2010 Author Share Posted January 26, 2010 i'm so noob... Thank's forget about it plz... Link to comment Share on other sites More sharing options...
boern Posted April 15, 2010 Share Posted April 15, 2010 its not an sollution, but an work around,you can compile your script with an old AutoIt Version:an easy way would be paste your code in the AutoIt Compilerand use Version 3.2.10.0 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