Sign in to follow this  
Followers 0
renehasp

Autoit running a BAT to do a systemstate backup

2 posts in this topic

Hi guys, I need you help yo figure this out.

Goal- Autoit file to run on Windows 2003 and Windows 2003 X64 that calls a bat file

I have a autoit file

-----------------------------------------------------------------------------------------------------------START

#NoTrayIcon

#Region

#RequireAdmin

#AutoIt3Wrapper_UseX64=n

#AutoIt3Wrapper_Res_Comment=12-05-11 SRV Wrapper

#EndRegion

;~ Parantal embeded funtionality

#include <GUIConstantsEx.au3>

#include <ProgressConstants.au3>

#include <StaticConstants.au3>

#include <GUIConstantsEx.au3>

#include <Date.au3>

#include <file.au3>

Global $ecode, $filecopy, $OI, $Banner ,$Banner2, $PackageName, $PackageName2, $systemdrive

$ecode = "0"

$PackageName = "SRV_PreBuild V11.10"

$Banner = $PackageName & " is now : "

If $CmdLine[0] = 0 Then

PackageInstall()

ExitInstaller()

EndIf

Func PackageInstall()

If @OSVersion = "WIN_2008" Then

SplashTextOn("Test, Inc. - WIN_2008",$Banner & "Installing....Please Wait",550,50,-1,10)

$OI = ShellExecuteWait("PreBuild3.bat")

Sleep (5000)

Send("{Enter}")

Else

SplashTextOn("Test, Inc.- WIN_2003",$Banner & "Installing....Please Wait",550,50,-1,10)

run("PreBuild3.bat")

EndIf

EndFunc

Func ExitInstaller()

EXIT

EndFunc

---------------------------------------------------------------------------------------------------------------------------------------------------END

I have a bat file called prebuild.bat

------------------------------------------------------------------------------------------------------------------------------------------------------START

start wait C:\WINDOWS\SYSTEM32\ntbackup.exe backup systemstate /j "Test" /f "d:\SystemState-Backup\test.bkf"

------------------------------------------------------------------------------------------------------------------------------------------------------END

The error I keep getting from autoit is...

C:\test\coachbuild>C:\WINDOWS\SYSTEM32\ntbackup.exe backup systemstate /j "Test"

/f "d:\SystemState-Backup\test.bkf"

'C:\WINDOWS\SYSTEM32\ntbackup.exe' is not recognized as an internal or external

command,

operable program or batch file.

But if I run the BAT file alone it works fine... Any help would be appreciated. I need to have autoi run multiple batch files so this is just a small example. Rewriting all the batch files is not an option right now. :D

Please help...

-Rene

Share this post


Link to post
Share on other sites



OOps reposed in support forum.. :D

Share this post


Link to post
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
Sign in to follow this  
Followers 0