avery Posted August 14, 2008 Share Posted August 14, 2008 (edited) I am not sure this is my problem but it's the only thing I've been able to think up so far. I come here to get more advice hopefully. The script runs perfect on the XP machine I compiled it on but not on the XP machine I need to run it on. The thing I found different so far is the directory Windows is installed in. On my Windows XP box windows is located in the default location of C:\WINDOWS and the target uses C:\WINNT. When I compile the script into a .exe does it take and store the @ComSpec from that machine or does it check each time on the machine it's being executed on? Does anyone know a quick fix for this if you do believe it's the problem? I was thinking of a simple if statement and losing the use of the @ComSpec built-in. Thanks for any help you can offer. Avery- Func install_dod_inf() ; use /c flag to close window /k leaves it open to debuff ToolTip("This process could take several minutes. " & @CRLF & "Adding NISPOM CH8 Security and Permission settings." & @CRLF & "Ask you Security representative for more information." & @CRLF & "This Status Message will close when the process is complete.", 1, 1, "Status: DoD Security Tool", 1) Run(@ComSpec & ' /c secedit /configure /db "' & @ProgramFilesDir & '\NISP_Utilities\DoD.sdb" /cfg "' & @ProgramFilesDir & '\NISP_Utilities\DoD.inf" /verbose', "", @SW_HIDE) ToolTip("", 1, 1, "", 1) EndFunc When I run the exe, I get -1 error with something about 'not found'. Run fine on my box just not the target. This is just one function in a very big script. Edited August 14, 2008 by avery www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 Did you try ShellExecute()? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
avery Posted August 14, 2008 Author Share Posted August 14, 2008 (edited) Did you try ShellExecute()?ShellExecute("cmd.exe") will work on any setup no mater where Windows is installed?Thanks,Averyedit:ShellExecuteWait('cmd.exe /c secedit /configure /db "' & @ProgramFilesDir & '\NISP_Utilities\DoD.sdb" /cfg "' & @ProgramFilesDir & '\NISP_Utilities\DoD.inf" /verbose', "", @SW_HIDE)cmd.exe is not found. looks like I still need to determine full path and add that :\ Edited August 14, 2008 by avery www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 ShellExecute("cmd.exe") will work on any setup no mater where Windows is installed? Thanks, Avery edit: ShellExecuteWait('cmd.exe /c secedit /configure /db "' & @ProgramFilesDir & '\NISP_Utilities\DoD.sdb" /cfg "' & @ProgramFilesDir & '\NISP_Utilities\DoD.inf" /verbose', "", @SW_HIDE) cmd.exe is not found. looks like I still need to determine full path and add that :\Ahh, do you have to run cmd.exe? I was suggesting you just try and run your .sdb or .inf file with parameters. I can't remember how autoit gets the location. Try this in place of @Comspec, use _myComspec()_myComspec() Func _myComspec() Local $t_comspec = DllStructCreate("char[260]") Local $a_comspec = DllCall("Kernel32.dll", "int", "GetEnvironmentVariable", "str", "COMSPEC", "ptr", DllStructGetPtr($t_comspec), "dword", 260) If IsArray($a_comspec) And $a_comspec[0] > 0 Then Return DllStructGetData($t_comspec, 1) Return SetError(1, 0, "") EndFuncI'd be interested to see if it is different. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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