mokla Posted May 13, 2008 Share Posted May 13, 2008 Hello every one,I have a problem with "RUN" Command and @comspec.My code:Dim $User=@UserName Dim $Directory="\\2950-1\DATAUSERS_quotas\" & $User;Dim $commande='c:\windows\system32\cmd.exe /c Echo o| cacls \\2950-1\DATAUSERS_quotas\' & $User & ' /C /G ' & $User & ':F "Admins du domaine":F'Dim $commande='/c Echo o| cacls \\2950-1\DATAUSERS_quotas\' & $User & ' /C /G ' & $User & ':F "Admins du domaine":F'RunAsSet("my_user","my_domain","my_password")DirCreate($Directory);RunWait($commande,'',@SW_HIDE)RunWait(@ComSpec & $commande,'',@SW_HIDE)RunAsSet()When i launch my program in AutoIT with the command "RunWait(@ComSpec & $commande,'',@SW_HIDE)" i have this error :C:\Documents and Settings\cth\Mes documents\test.au3 (15) : ==> Unable to execute the external program.: RunWait(@ComSpec & $commande,'',@SW_HIDE) Paramètre incorrect.If I replace "@ComSpec" by the path of %ComSpec% (Dim $commande='c:\windows\system32\cmd.exe /c Echo o| cacls \\2950-1\DATAUSERS_quotas\' & $User & ' /C /G ' & $User & ':F "Admins du domaine":F' and RunWait($commande,'',@SW_HIDE)), it's ok on my workstationBut on another workstation it does not work why this error : Line -1:Error : Unable to execute the external program.the name of directory is incorrectFor this another workstation if I use this command : "RunWait(@ComSpec & $commande,'',@SW_HIDE)" and i build my program, It's does not work too.You can help me to work my program thank you for you helpChristian PS : Sorry for my English Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 13, 2008 Share Posted May 13, 2008 My code: Dim $commande='/c Echo o| cacls \\2950-1\DATAUSERS_quotas\' & $User & ' /C /G ' & $User & ':F "Admins du domaine":F' Put a space before "/c": Dim $commande=' /c Echo o| cacls \\2950-1\DATAUSERS_quotas\' & $User & ' /C /G ' & $User & ':F "Admins du domaine":F' Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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