Efo74 Posted May 8, 2016 Share Posted May 8, 2016 Hello, Today I'm working with Office 2016 Deployment tool, all is working, but... at the end of office deploy i need to launch manually the file oemsetup.cmd with Mode=OEM parameter. In an elevate Administrator i launch the command oemesetup.cmd Mode=OEM and all is working fine, but i would like to automate this command in Autoit. I test this commands and no one seems to work: #include <Process.au3> $dos_command = '"' & @ScriptDir & '\oemsetup.cmd" Mode=OEM' $retval = RunWait(@ComSpec & " /c " & $dos_command,@ScriptDir) Msgbox(0,"RunWait",$retval) $retval = _RunDos(@ComSpec & " /c " & $dos_command) Msgbox(0,"_RunDos",$retval) all the command return 255. OS: Win10.586 x64 can someone help me to fix this problem ?? Thank you. :rolleyes: Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2016 Developers Share Posted May 8, 2016 Have you tried setting the workdir parameter to the @scriptdir as well on the runwait command Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 Yes, I have tied. :rolleyes: Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2016 Developers Share Posted May 8, 2016 (edited) Why are you adding the scriptdir at all since you stated you done do that from the command prompt? Are you running the script in Admin mode and how did you do that? Jos Edited May 8, 2016 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 #RequireAdmin #include <Process.au3> $dos_command = '"' & @ScriptDir & '\oemsetup.cmd" Mode=OEM' $retval = RunWait(@ComSpec & " /c " & $dos_command) Msgbox(0,"RunWait",$retval) $retval = _RunDos(@ComSpec & " /c " & $dos_command) Msgbox(0,"_RunDos",$retval) add requireadmin and remove @Scriptdir ... not working :rolleyes: Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 I'm not starting from command prompt. From command prompt I'm execute the batch directly :rolleyes: Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 #RequireAdmin #include <Process.au3> $dos_command = 'oemsetup.cmd Mode=OEM' $retval = RunWait(@ComSpec & " /c " & $dos_command) Msgbox(0,"RunWait",$retval) $retval = _RunDos(@ComSpec & " /c " & $dos_command) Msgbox(0,"_RunDos",$retval) remove @scriptdir from command... not working (compiled script exe is in the same directory of oemsetup.cmd) :rolleyes: Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2016 Developers Share Posted May 8, 2016 So back to the basics: What is the exact command you type in the admin level CMD window ? Which directory is the workdir at that moment? What is the issue when you run the script? Try running it with /k in stead of /c to see if there is any error shown. Jos Synapsee 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 Thank you Jos : I don't know the command /k whith /k I have this dos prompt: \Common not expected. D:\O2K16OEM> :rolleyes: Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2016 Developers Share Posted May 8, 2016 .. and? did you solve it? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 No ... but is a start. Can I send you the batch file ? :rolleyes: Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2016 Developers Share Posted May 8, 2016 Don't need that as you can look into that yourself and find the reference to this error...right? The thing is that I asked 4 questions and am missing the answer of the first 3! You need to determine what is different in running it manually from the CMD prompt and via the script! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 I test this in a VM with Windows 10.586 in Audit Mode (CTRL-SHIFT-F3). This VM have 2 virtual drive C: and D: In C: this is only OS. In D: there is a folder D:\O2K16OEM ... in this folders there are two files myscript.exe (compiled script for automate oemsetup.cmd and silent install office) and oemsetup.cmd If i run Comand Prompt like administrator and go to D:\O2K16OEM and launch oemsetup.exe Mode=OEM the command is working fine. But If I launch myscript.exe whit (/k) i have in a dos box: \Common not expected. D:\O2K16OEM> and the command is not working. :rolleyes: Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 oops the command is : oemsetup.cmd Mode=OEM :rolleyes: Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2016 Developers Share Posted May 8, 2016 (edited) Could it be an x86/x64 issue? HAve you tried running the command from a x86 cmd prompt? Could also try compiling the script as an X64 outputfile. Jos Edited May 8, 2016 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Efo74 Posted May 8, 2016 Author Share Posted May 8, 2016 Thank you very much Jos. This is a x86/64 issue: I have compile same script in x86/64 x86: not working ....\Common not expected ... error x64: working Synapsee 1 :rolleyes: Link to comment Share on other sites More sharing options...
Developers Jos Posted May 8, 2016 Developers Share Posted May 8, 2016 Nice SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
iamtheky Posted May 8, 2016 Share Posted May 8, 2016 Quote x86: not working ....\Common not expected ... error That x86 @scriptdir wouldnt happen to be "\Common Files\" would it? If so, try '"' & @scriptdir & '"'. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) 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