sno Posted June 3, 2005 Share Posted June 3, 2005 Why cant i get this simple codesample working, yes it does wat it must do but the result are not good. Kix32 gives me "ERROR : failed to find/open script!" even when i hardcode the same command line in de code it doesnt work, why? If $CmdLine[0] < 2 Then Exit(1) runKix($CmdLine[1], $CmdLine[2]) Func runKix($context, $script) If $context == "/adm" Then RunAsSet("administrator", @LogonDomain, "password") $cmd = "kix32.exe " & $Script MsgBox(4096, "Debug", $cmd , 10) ; 0 -> Do not display RunWait errors Opt("RunErrorsFatal", 1) RunWait($cmd, ".") ; Reset user's permissions RunAsSet() Exit(0) EndIf EndFunc Grtx Sno. The Novice Newbie. Link to comment Share on other sites More sharing options...
MHz Posted June 3, 2005 Share Posted June 3, 2005 By what method are you using, to run this. Compiled, editor, right-click? What does the msgbox report. Is it the full script name, that you would expect? Link to comment Share on other sites More sharing options...
sno Posted June 3, 2005 Author Share Posted June 3, 2005 (edited) By what method are you using, to run this. Compiled, editor, right-click?YesWhat does the msgbox report. Is it the full script name, that you would expect?<{POST_SNAPBACK}>Yes, also tried variation as RunAsSet("administrator", @LogonDomain, "password") $cmd = "start " & @LogonServer & "\netlogon\kix32.exe " & $Script $cmd1 = (@ComSpec & " /c " & $cmd)Any idea?ANd yes i know that compiling the password is bad Edited June 3, 2005 by sno Grtx Sno. The Novice Newbie. Link to comment Share on other sites More sharing options...
MHz Posted June 3, 2005 Share Posted June 3, 2005 With RunWait() - You don need to specify a full path to the file. Leave out the working directory parameter, if not needed. With Comspec. - Double check your start command. The start command has changed of late? Now has title parameters etc. You may need to use: Start "" path\file.exe ? Link to comment Share on other sites More sharing options...
sno Posted June 3, 2005 Author Share Posted June 3, 2005 With RunWait() - You don need to specify a full path to the file. Leave out the working directory parameter, if not needed.With Comspec.- Double check your start command. The start command has changed of late? Now has title parameters etc. You may need to use: Start "" path\file.exe ?<{POST_SNAPBACK}>I dont understand why it does not work, il be debuging some more when i get home. but for now all variations a tried fail (and i think i have tried quit a couple) Grtx Sno. The Novice Newbie. Link to comment Share on other sites More sharing options...
MHz Posted June 3, 2005 Share Posted June 3, 2005 You could try this with your last try RunAsSet("administrator", @LogonDomain, "password") $cmd = 'start "" "' & @LogonServer & '\netlogon\kix32.exe" "' & $Script & '"' RunWait(@ComSpec & " /c " & $cmd) Link to comment Share on other sites More sharing options...
sno Posted June 3, 2005 Author Share Posted June 3, 2005 You could try this with your last tryRunAsSet("administrator", @LogonDomain, "password") $cmd = 'start "" "' & @LogonServer & '\netlogon\kix32.exe" "' & $Script & '"' RunWait(@ComSpec & " /c " & $cmd)<{POST_SNAPBACK}>Almost :-)$cmd = '"' & @LogonServer & '\netlogon\kix32.exe" "' & $Script & '"' MsgBox(4096, "Debug", $cmd , 10) RunWait($cmd, ".", @SW_MAXIMIZE )This does the trick tho, man many thx for that """""" stuf!! Any idea where i can read about the syntax used (double "" and so on) i was looking for it in the help earlyer. Grtx Sno. The Novice Newbie. Link to comment Share on other sites More sharing options...
MHz Posted June 4, 2005 Share Posted June 4, 2005 Almost :-)$cmd = '"' & @LogonServer & '\netlogon\kix32.exe" "' & $Script & '"' MsgBox(4096, "Debug", $cmd , 10) RunWait($cmd, ".", @SW_MAXIMIZE )This does the trick tho, man many thx for that """""" stuf!! Any idea where i can read about the syntax used (double "" and so on) i was looking for it in the help earlyer.<{POST_SNAPBACK}>I can point you, in the right direction.It is located in AutoIt Help. Look in Contents, then open the Language Reference topic folder, then click on Datatypes. Or see online here.Strings:Basically, you can put double quotes, inside single quotes. This allows the double quotes to be passed to the command interpreter, etc. ( Which is my preference. I use single quotes by default, with AutoIt. Seems easier to type and easier when you need to pass double quotes. )Or you can double up the double quotes. The inner double quotes will be passed to the command interpreter etc. 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