chrisT Posted February 28, 2014 Posted February 28, 2014 (edited) Hi.. I'm trying to run WBAdmin.exe the win7/win8 backup using autoit, in both code examples below I get C:WLD VMRC>wbadmin /? 'wbadmin' is not recognized as an internal or external command, operable program or batch file. However when I run simply by manually opening a cmd prompt it will work C:Windowssystem32>wbadmin /? wbadmin 1.0 - Backup command-line tool © Copyright 2013 Microsoft Corporation. All rights ---- Commands Supported ---- START BACKUP -- Runs a one-time backup....... etc. Am I missing something here, any help appreciated, thanks #requireadmin Run("C:\WINDOWS\system32\cmd.exe") WinWaitActive("C:\WINDOWS\system32\cmd.exe") Send("wbadmin /?" & "{ENTER}") Exit #requireadmin $CMD = 'wbadmin /?' ;$CMD = 'c:\Windows\System32\wbadmin.exe /?' ;$CMD = "Ping 192.168.1.1" RunWait('"' & @ComSpec & '" /k ' & $CMD, @SystemDir) Exit Edited February 28, 2014 by chrisT
orbs Posted February 28, 2014 Posted February 28, 2014 both your scripts work for me (Windows 7 32-bit). but anyway, what's wrong with direct call? add your switches to this: RunWait("wbadmin") Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
Solution jguinch Posted February 28, 2014 Solution Posted February 28, 2014 (edited) It's because you're running a x64 Windows and your script is runnig in x86 mode. The wbadmin.exe command is stored in c:windowssystem32, and the x86 cmd maps the @SystemDir to C:WindowsSysWOW64 folder. If you want to access to the x64 commands from a x86 script, you can use @WindowsDir & "sysnative" instead of @SystemDir, or change the PATH environment variable before calling the command, like this EnvSet("PATH", @WindowsDir & "\sysnative;" & EnvGet("PATH") ) RunWait('"' & @ComSpec & '" /k ' & $CMD, @SystemDir) Edited February 28, 2014 by jguinch chrisT and LeoSS 2 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
chrisT Posted February 28, 2014 Author Posted February 28, 2014 Thanks guys for your responses, jguinch that explanation was spot on & steered me in the right direction, found this article & it cleared out all my remaining questions http://ovidiupl.wordpress.com/2008/07/11/useful-wow64-file-system-trick/ for others who may come this way
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