Jump to content

Run WBAdmin.exe Help


chrisT
 Share

Go to solution Solved by jguinch,

Recommended Posts

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 by chrisT
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • Solution

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 by jguinch
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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