Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Page Index Toggle Pages: 1
Send Topic Print
Batch file(s) execution after Ghost restore.. (Read 2953 times)
bananaheadache
Ex Member




Back to top
Batch file(s) execution after Ghost restore..
Jan 6th, 2005 at 10:14pm
 
Hello,

I'm using Ghost 2003 and I've a question about automating the execution of a couple batch files after doing a ghost partition restore from a ghost bootable cd-rom.

The contents of my ghost.bat file looks like this:

GHOST.EXE -clone,MODE=pload,SRC=1:2\recovery\CDR00000.GHO:1,DST=1:1 -sure -fx -ntchkdsk

The restore process is almost entirely automated except for two things after the restore completes.

1) I want to eject the cd-rom automatically when the ghost restore completes and returns to a DOS prompt.  (I've manually tested and successfully executed a program called CDROMCOM.EXE from a DOS prompt to eject the cd-rom drive without pressing the ejection button on the drive)

2) After the cd-rom drive ejects the ghost bootable cd i want to reboot the computer allowing the restored partition to boot up into the newly restored OS.  Here are the contents of a batch file named reboot.bat that I'm considering using to reboot the computer after the automated ejection of the ghost bootable cd. I've tested it and it works fine when manually executed from a DOS prompt:

@ECHO OFF
echo g=ffff:0000 | debug

I've already tried using the -rb switch in my ghost.bat file to reboot but I would also need an eject cd switch in order for all my desired automation to work from the ghost.bat file.

The only switch I could find even remotely related to ejecting media was the -tapeeject switch.  Perhaps someone has an idea how to accomplish the above in a more efficient manner or knows of a ghost switch I could use to eject a cd from within ghost.bat (maybe ghost 9.0 has a switch?)

In addition i've listed the contents of my AUTOEXEC.BAT and CONFIG.SYS for further clarification of the level of automation i'm trying to accomplish. (perhaps another if statement after the ghost.bat within the AUTOEXEC.BAT would work? unfortunately i'm a novice at DOS)

AUTOEXEC.BAT
--------------------
@ECHO OFF
mouse.com
path=a:\;%CDROM%:\
cls
IF "%config%"=="NOCD" GOTO LQUIT
LH MSCDEX.EXE /D:cdrom001 /L:E /M:30
set CDROM=FOO23
DETECTCD.EXE
IF "%CDROM%"=="FOO23" GOTO NOCDROM
%CDROM%
cls
IF "%config%"=="SUCD" GOTO LQUIT
ghost.bat
GOTO LQUIT
:NOCDROM
cls
echo.
echo DetectCD was unable to determine the CD-ROM drive letter.
echo.
:LQUIT
set CDROM=

CONFIG.SYS
----------------
[menu]
menuitem=GHOST, You are about to Recover/Restore your computer.
menudefault=CD,10
menucolor=7,0

[SUCD]
device=himem.sys /testmem:off
device=oakcdrom.sys /D:cdrom001
device=btdosm.sys
device=flashpt.sys
device=btcdrom.sys /D:cdrom001
device=aspi2dos.sys
device=aspi8dos.sys
device=aspi4dos.sys
device=aspi8u2.sys
device=aspicd.sys /D:cdrom001

[NOCD]
device=himem.sys /testmem:off

[GHOST]
device=himem.sys /testmem:off
device=oakcdrom.sys /D:cdrom001
device=btdosm.sys
device=flashpt.sys
device=btcdrom.sys /D:cdrom001
device=aspi2dos.sys
device=aspi8dos.sys
device=aspi4dos.sys
device=aspi8u2.sys
device=aspicd.sys /D:cdrom001

[COMMON]
files=60
buffers=20
dos=high,umb
stacks=9,256
lastdrive=z
device=display.sys con=(ega,,1)
country=001,437,country.sys
install=mode.com con cp prepare=((437) ega.cpi)
install=mode.com con cp select=437
install=keyb.com us,,keyboard.sys


TIA Any help would be greatly appreciated!
 
 
IP Logged
 

Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Batch file(s) execution after Ghost restore..
Reply #1 - Jan 8th, 2005 at 1:33am
 
Hey.

You need a batch-file guru. Unfortunately I am not one. I assume you've already reviewed the batch files located here:

http://ghost.radified.com/ghost_4.htm

I can offer only moral support at this point.
 
WWW  
IP Logged
 
NightOwl-
Übermensch
*****
Offline


"I tought I saw a puddy
tat...."

Posts: 2094
Olympia, WA--Puget Sound-USA


Back to top
Re: Batch file(s) execution after Ghost restore..
Reply #2 - Jan 8th, 2005 at 1:57am
 
bananaheadache

If you already have DOS commands to eject the disk, and reboot the system, you should be able to have those as the last two commands in your autoexec.bat file.

You may have to create a separate .bat file for the ghost command line, and have the autoexec.bat file 'call' that batch file, and after it returns to the DOS prompt, you should be taken back to the next command in the autoexec.bat file.

I can not remember the exact commands, but I had an old IBM PS/1 computer whose autoexec.bat file called a 'hardware check' batch file that ran mid-way through the sequence in the autoexec.bat, then returned and completed the rest of the commands in the autoexec.bat file, and then booted Windows.

Might find what you need here:

http://www.vfrazee.com/ms-dos/6.22/help/

Check out the 'Call' and 'Batch Commands'.
 

No question is stupid...but, possibly the answers are  Wink !
(This is an old *NightOwl* user account--not in current use.  Current account is NightOwl without a dash at the end.)
 
IP Logged
 
bananaheadache
Ex Member




Back to top
Re: Batch file(s) execution after Ghost restore..
Reply #3 - Jan 8th, 2005 at 11:18am
 
Hey thanks for the responses,

I've now got some great ideas perkulating and I'll post my solution once I get this little automation tested good and proper.
Thanks again!
 
 
IP Logged
 
NightOwl-
Übermensch
*****
Offline


"I tought I saw a puddy
tat...."

Posts: 2094
Olympia, WA--Puget Sound-USA


Back to top
Re: Batch file(s) execution after Ghost restore..
Reply #4 - Jan 14th, 2005 at 8:06pm
 
bananaheadache

If you're still working on this batch file project, ran across this Ghost switch here:

http://service1.symantec.com/SUPPORT/ghost.nsf/8f7dc138830563c888256c2200662ecd/...

Quote:
-FX

User intervention

Causes Ghost to exit to DOS after an operation is complete. By default, Ghost prompts the user to restart or exit when the operation has finished. If Ghost is run as part of a batch file, it is sometimes useful to exit back to the DOS prompt after completion so that further batch commands are processed.

Symantec Ghost 8.0

Norton Ghost 2003


It may help in allowing the batch file to continue after Ghost is done doing it's thing.
 

No question is stupid...but, possibly the answers are  Wink !
(This is an old *NightOwl* user account--not in current use.  Current account is NightOwl without a dash at the end.)
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print