Jump to content

Recommended Posts

Posted

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:

  • Developers
Posted (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 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.
  :)

Posted

#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:

Posted

#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:

  • Developers
Posted

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

 

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.
  :)

Posted

Thank you Jos : I don't know the command /k

whith /k I have this dos prompt:

\Common not expected.

D:\O2K16OEM>

:rolleyes:

  • Developers
Posted

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.
  :)

Posted

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:

  • Developers
Posted (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 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.
  :)

Posted

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 :lmao:

:rolleyes:

Posted
Quote

x86: not working ....\Common not expected ... error

That x86 @scriptdir wouldnt happen to be "\Common Files\" would it?  If so, try '"' & @scriptdir & '"'.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...