Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Pages: 1 2 
Send Topic Print
Auto ghost back the latest ghost and eject the cd (Read 23584 times)
an illusions
Dude
*
Offline


I Love Radified!

Posts: 13


Back to top
Auto ghost back the latest ghost and eject the cd
Jun 21st, 2012 at 5:48pm
 
My bootable cd

Use at your own risk.
The batch file will ghostback your latest ghostfile.gho to first
unhidden primary partition.

Assumption
   ghostfile.gho is located in main directory on one drive
   ghostfile.gho is name as ghostfile1.gho, ghostfile2.gho etc.



Can download the file here...

Link to download removed by NightOwl


Edited:
Edit by Nightowl--6/23/2012 at approx. 11:00 am

Your download appears to contain a working copy of *ghost.exe*--that's a protected, licensed program by Symantec, and distributing it would be a violation of their EULA!  That's the one main rule we have here on our forum--no distribution of licensed software that is not freeware or in the public domain for free use and distribution.

I have temporarily removed your link.

You can offer a download without that proprietary program that others can then copy their properly licensed version of the program to the boot disc, disk, or usb flashdrive.




config.sys  -------------


device=himem.sys /testmem:off /numhandles=128 /Q


device=AHCI.SYS /D:sata
device=UIDE.SYS /D:gen
device=emm386.exe NOEMS I=B000-B7FF
device=ansi.sys
shell=\command.com /e:2048 /f /p

fileshigh=40
buffershigh=15
dos=high,umb
stackshigh=0,0
fcbshigh=4,0
LASTDRIVE=Z
BREAK=ON

autoexec.bat -----------------------


@echo off
prompt $p$g
SET TZ=GHO-08:00

echo Loading driver...
LH MSCDEX.EXE /D:sata /D:gen /L:x
LH doskey.com /insert
LH mouse

set cddrv=
findcd -e -r
if errorlevel 23 set cddrv=x
if errorlevel 24 set cddrv=y
echo %cddrv%: CD drive with media
path a:;%cddrv%:

cls
ntfs4dos findG.bat


findG.bat ----------------------

rem autoghost findG cd version

@echo off

rem booting from cd


rem hd c       hd1,1 -- assign c
rem hd d       hd1,2 -- assign d
rem hd e       hd1,3 -- assign e



rem Check drives for existence of .gho file and return drive letter

set drive=
if exist D:\*.gho set drive=D:
if exist E:\*.gho set drive=E:
if exist F:\*.gho set drive=F:
if exist G:\*.gho set drive=G:
if exist H:\*.gho set drive=H:
if exist I:\*.gho set drive=I:
if exist J:\*.gho set drive=J:
if exist K:\*.gho set drive=K:
if exist L:\*.gho set drive=L:
if exist M:\*.gho set drive=M:
if exist N:\*.gho set drive=N:
if exist O:\*.gho set drive=O:
if exist P:\*.gho set drive=P:
if exist Q:\*.gho set drive=Q:
if exist R:\*.gho set drive=R:
if exist S:\*.gho set drive=S:
if exist T:\*.gho set drive=T:
if exist U:\*.gho set drive=U:
if exist V:\*.gho set drive=V:
if exist W:\*.gho set drive=W:
rem if exist X:\*.gho set drive=X:
rem if exist Y:\*.gho set drive=Y:
if exist Z:\*.gho set drive=Z:

%drive%
FOR %%l IN (*.gho) do set ghofile=%%l

set drive2=
if exist D:\*.gho set drive2=1:2
if exist E:\*.gho set drive2=1:3
if exist F:\*.gho set drive2=1:4
if exist G:\*.gho set drive2=1:5
if exist H:\*.gho set drive2=1:6
if exist I:\*.gho set drive2=1:7
if exist J:\*.gho set drive2=1:8
if exist K:\*.gho set drive2=1:9
if exist L:\*.gho set drive2=1:10
if exist M:\*.gho set drive2=1:11
if exist N:\*.gho set drive2=1:12
if exist O:\*.gho set drive2=1:13
if exist P:\*.gho set drive2=1:14
if exist Q:\*.gho set drive2=1:15
if exist R:\*.gho set drive2=1:16
if exist S:\*.gho set drive2=1:17
if exist T:\*.gho set drive2=1:18
if exist U:\*.gho set drive2=1:19
if exist V:\*.gho set drive2=1:20
if exist W:\*.gho set drive2=1:21
rem if exist X:\*.gho set drive2=1:22
rem if exist Y:\*.gho set drive2=1:23
if exist Z:\*.gho set drive2=1:24


echo.
[0;32;40m
echo  * Ghost file
[1;33;40m%ghofile%
[0;32;40m at drive 
[1;33;40m%drive%
[0;32;40m
echo  * check if disk:volume 
[1;33;40m%drive2%
[0;32;40m  match the table above else
[1;33;40m
input " * type the correct disk:volume =  " drive2 /E /L4
echo.
[0m

if exist d:\windows GOTO part2

echo ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:1 -FX
pause
ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:1 -FX
goto done

:part2

echo ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:2 -FX
pause
ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:2 -FX
:done
cls
ej %CDDRV%:
ECHO --------------------------------------------------------------------------------

ECHO Please remove the CD now
PAUSE
restart


 
 
IP Logged
 

an illusions
Dude
*
Offline


I Love Radified!

Posts: 13


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #1 - Jun 21st, 2012 at 6:06pm
 
AHCI.SYS   ---  dos sata cd driver

ej.com  ---  eject the CD-ROM tray
EJ.COM    v1.04    2003-07-01    Charles Dye    raster@highfiber.com

findcd.com  --- find where the cd is located if you have more than one cd drive
FindCD v1.02, (c) 2000-2001, Bart Lagerweij
27 nov 2001, http://www.nu2.nu/contact/bart

Ghost.Exe  ---  dos v11

input.com  --- enable to input from keyboard

mscdex.exe   --- Microsoft MS-DOS CD-ROM Extensions

ntfs4dos.exe  ---  Avira NTFS4DOS enables a large number of DOS programs to access NTFS-formatted drives.
http://avira-ntfs4dos-personal.avira-gmbh.qarchive.org/

pause.sys  --- Pause `Config.sys'  for debugging
  PAUSE - Pause `Config.sys' processing
  1997-2006 BTTR Software

RESTART.COM  --- restart the computer from dos

UIDE.SYS  ---  dos ide generic cd driver 
get latest UIDE here
http://johnson.tmfc.net/dos/driver.html



 
 
IP Logged
 
NightOwl
Radministrator
*****
Offline


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

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


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #2 - Jun 22nd, 2012 at 10:06am
 
@
an illusions

Impressive!  Some very advanced functions.

Quote:

Looks like this requires signing up with the *Box* website.

It will take some time to digest how the various components of the *config.sys* and *autoexec.bat* work--I have not learned how variables in DOS are used--and you use several in the various commands above.

You have some interesting programs that enable nice functions.  Not sure where this fits in:

Quote:
pause.sys  --- Pause `Config.sys'  for debugging
  PAUSE - Pause `Config.sys' processing
  1997-2006 BTTR Software

I see that *pause* is called by your boot files in serveral places--but I thought *pause* was a standard DOS command available without having to add a separate program.  Are you using *pause.sys* in your above *autoexec.bat?  Wouldn't this conflict with the DOS *pause* function?


 

____________________________________________________________________________________________

No question is stupid ... but, possibly the answers are Wink !
 
IP Logged
 
Brian
Demigod
******
Offline



Posts: 6271
NSW, Australia


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #3 - Jun 22nd, 2012 at 4:58pm
 
Sounds suspicious???? Having to create a "Box" account and then finding the file has been deleted!
 
 
IP Logged
 
an illusions
Dude
*
Offline


I Love Radified!

Posts: 13


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #4 - Jun 22nd, 2012 at 7:42pm
 
@ Nightowl  @Brian

Sorry, the link to download should be

Link to download removed by NightOwl


Edited:
Edit by Nightowl--6/23/2012 at approx. 11:00 am

Your download appears to contain a working copy of *ghost.exe*--that's a protected, licensed program by Symantec, and distributing it would be a violation of their EULA!  That's the one main rule we have here on our forum--no distribution of licensed software that is not freeware or in the public domain for free use and distribution.

I have temporarily removed your link.

You can offer a download without that proprietary program that others can then copy their properly licensed version of the program to the boot disc, disk, or usb flashdrive.





@ Nightowl

Pause.sys is use in config.sys  and does not conflict with autoexec.bat    pause function.

for example if you would like to test each line in config.sys


device=himem.sys /testmem:off
device=pause.sys

device=AHCI.SYS /D:sata
device=pause.sys

device=UIDE.SYS /D:gen
device=pause.sys

etc ....


device=pause.sys <--- should be removed after debugging

more info here

http://www.angelfire.com/electronic/tristar/debug/debug/InsertPausesInConfigSys....

 
 
IP Logged
 
Brian
Demigod
******
Offline



Posts: 6271
NSW, Australia


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #5 - Jun 22nd, 2012 at 10:45pm
 
@
an illusions

Thanks for the new download link. Hey, that is nice. Way out of my league but I'm going to keep playing until I understand it better. I've already done a few semi-auto restores.

One observation. The partition containing my .gho file is correctly calculated as disk3 volume1 but the yellow text says it is 1:4. I can change this to 3:1 and the restore takes place. Impressive.

 
 
IP Logged
 

an illusions
Dude
*
Offline


I Love Radified!

Posts: 13


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #6 - Jun 22nd, 2012 at 11:23pm
 
@ Brain

NTFS4dos always calculate the correct disk and volume number but my dos batch assume there is only 1 harddrive.   Therefore, I added the Input function so you can correct the disk and volume to the right one.   Cheesy
 
 
IP Logged
 
Brian
Demigod
******
Offline



Posts: 6271
NSW, Australia


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #7 - Jun 22nd, 2012 at 11:41pm
 
@
an illusions

I moved the .gho to the first HD and now it works as you described. I understand.

Edit... Does this work from a USB flash drive or does it have to be on a CD?
 
 
IP Logged
 
Brian
Demigod
******
Offline



Posts: 6271
NSW, Australia


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #8 - Jun 23rd, 2012 at 12:10am
 

Just saw your USB link.
 
 
IP Logged
 
Brian
Demigod
******
Offline



Posts: 6271
NSW, Australia


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #9 - Jun 23rd, 2012 at 12:51am
 
@
an illusions

LBA-62 on HD0 is "marked" during the restore process. Can this be avoided?
 
 
IP Logged
 
an illusions
Dude
*
Offline


I Love Radified!

Posts: 13


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #10 - Jun 23rd, 2012 at 1:18am
 
Brian wrote on Jun 23rd, 2012 at 12:51am:
LBA-62 on HD0 is "marked"



Sorry, I never encountered such error msg.   

Maybe you should create a new ghost.   Format that partition again and ghost back.

 
 
IP Logged
 

Brian
Demigod
******
Offline



Posts: 6271
NSW, Australia


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #11 - Jun 23rd, 2012 at 1:19am
 
Forget my comment. That happens anyway. It's not related to your CD.
 
 
IP Logged
 
Dan Goodell
Special Guest
*****
Offline



Posts: 549
N California


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #12 - Jun 23rd, 2012 at 1:55am
 
Haven't looked at the second thread yet, but some comments on this thread . . .


Observation #1:

The first group of "if exist" statements can be simplified with a foreach loop:
    for %%d in (d e f g h i j k l m n o p q r s t u v w z) do if exist %%d:\*.gho set drive=%%d:



Observation #2:

As designed, the script searches for .gho files only in the root directory of each drive.  It does not search subdirectories.



Observation #3:

As designed, the script expects there to be only one .gho file per drive.  If you have two or more .gho files, it takes the last one in the directory list.  Unfortunately, there's no way to consistently predict which .gho file that will be.  As files are written/rewritten, the order they appear in the directory list gets shuffled around.  It is not chronological, nor is it alphabetical.  Thus, if you use this script you should make sure you only have one .gho per root directory.



Observation #4:

As designed, the script expects there to be only one .gho file altogether.  If you have two or more drives with a .gho file in its root directory, the script takes the last drive it searches.



Observation #5:

As designed, the script assumes all drive letters refer to partitions on a single HDD.  It doesn't accomodate scenarios where the .gho file is on a secondary HDD, external HDD, CD/DVD, or network share.



Observation #6:

As designed, the script assumes that if it finds a D:\Windows directory, that D: refers to the second partition on the first HDD.  That can't be guaranteed.  It depends on the how many HDDs, their specific complement of primary vs extended partitions, and which of those might be FAT, FAT32, or NTFS.  Remember, DOS gets to assign drive letters first before ntfs4dos.exe gets its hands on what's left.



Observation #7:

Syntax error in findG.bat, line: "if exist d:\windows GOTO part2".  That DOS instruction does not check for a directory named windows, it checks for a file named windows.  To check for a directory, use the syntax: "if exist d:\windows\nul GOTO part 2".



Observation #8:

NightOwl's right--there seems to be some confusion with the "pause" command here.

First, Reply #1 refers to it as pause.sys, which means it's a device driver, not an executable you can call from a program or batch file.  With rare exception, device drivers need to be loaded via config.sys (e.g., via "device=pause.sys"), but there's no such line in config.sys.  Third, it's purpose is described as "Pause config.sys for debugging", but there are no pause commands used in config.sys.  Perhaps the author had it in config.sys during development and removed it after he was satisfied with the operation of his config.sys file?

As for whether it conflicts with DOS's pause command, there's no conflict, per se, but it may not be behaving as the author may have intended.

DOS follows very rigid rules.  All commands are categorized as internal commands or external commands.  Internal commands are those built into the command interpreter.  External commands are those that take the form of a standalone executable file.  External commands that come with DOS are typically stored in the C:\DOS directory by convention, but they don't need to be.  They could be anywhere.

When executing any command, DOS first looks to see if it's an internal command.  Next it looks for an external command (an executable file) in the current working directory.  If it's not in either of those places, it consults the PATH environment variable and begins searching those directories sequentially, following the priority in the PATH variable.  DOS stops at the first match it finds.  If you have multiple possibilities (e.g., two copies of "myprog.exe" in different directories) you need to understand the DOS search sequence to predict which copy it will find and run.

In this case, "pause" is an internal DOS command, so that takes first priority.

Aside:  For anyone curious about this notion of internal commands, try this: open a copy of command.com in Windows Notepad.  (Of course, you can't use notepad to edit a binary file, but all we're doing is looking for text strings.)  Scroll all the way to the bottom of the file.  Near the bottom you'll plainly see the jump list of internal commands.  Accompanying each command's text string is a four-byte jump vector (invisibly shown as blocks in a text editor) specifying the location elsewhere in the binary file where the actual code for that command begins.



And finally:

I see the author has included an "input" command to accomodate a bit of manual correction, though it doesn't address all of the potential trouble areas in the above observations.

Even at that, the input command assumes you know the correct disk:volume you want, so seems to presume some technical savvy.  Yet, how reliably can a user predict which order Ghost will enumerate HDDs?  How reliably can a user predict how Ghost enumerates volumes?  It's not strictly by physical position, it also depends on whether they are primary or logical.  If you keep your system very simple, you stand a good chance of getting it right.  But for a script wanting to have universal applicability, I'm not so sure.

At the very least, there should be some declaration of when this script won't work, so the user can avoid potential failure scenarios--some of which could have disastrous consequences.


 
 
IP Logged
 
an illusions
Dude
*
Offline


I Love Radified!

Posts: 13


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #13 - Jun 23rd, 2012 at 12:22pm
 
@  Dan Goodell 

Thank you for writing all the observations.   Yes, the batch file has its limitations.   I have uploaded the file so if any DOS expert
knows how to improve the batch file please revised it.

Dan Goodell wrote on Jun 23rd, 2012 at 1:55am:
Observation #1:

The first group of "if exist" statements can be simplified with a foreach loop:
for %%d in (d e f g h i j k l m n o p q r s t u v w z) do if exist %%d:\*.gho set drive=%%d:



Yes, and thank you.

For the second part Tech Support Guy forum -- Squashman suggested me this coding but it does not work on windows 98se DOS

set drive2=
FOR %%G IN ("E=2:2" "F=2:3" "G=2:4" "H=2:5" "I=2:6" "J=2:7" "K=2:8" "L=2:9" "M=2:10" "N=2:11" "O=2:12" "P=2:13" "Q=2:14" "R=2:15" "S=2:16" "T=2:17" "U=2:18" "V=2:19" "W=2:20"  "Z=2:24") DO (
     FOR /F "TOKENS=1,2 DELIMS==" %%H IN ('echo %%~G') DO (
           if exist %%H:\*.gho set drive2=%%I
     )
)


Dan Goodell wrote on Jun 23rd, 2012 at 1:55am:
Observation #2:

As designed, the script searches for .gho files only in the root directory of each drive.  It does not search subdirectories.

Observation #3:

As designed, the script expects there to be only one .gho file per drive.If you have two or more .gho files, it takes the last one in the directory list.Unfortunately, there's no way to consistently predict which .gho file that will be.As files are written/rewritten, the order they appear in the directory list gets shuffled around.It is not chronological, nor is it alphabetical.Thus, if you use this script you should make sure you only have one .gho per root directory.



Actually it does work if you have more than one ghost file in the root directory.   It will use the latest ghostfile.gho as long as you name it as
filename1.gho, filename2.gho, filename3.gho etc.

I don't know how to code it to search sub directory.


Dan Goodell wrote on Jun 23rd, 2012 at 1:55am:
Observation #5:

As designed, the script assumes all drive letters refer to partitions on a single HDD.It doesn't accomodate scenarios where the .gho file is on a secondary HDD, external HDD, CD/DVD, or network share.



As long as all SSD, HDD (SATA or IDE), external HDD are format in NTFS,  NTFS4dos can mapped it.  And if the coding assume the wrong drive and volume number,  the input command allowed the user to override and input the right one as per NTFS4dos mapping.   Yes, it does not work on network share.  The config.sys does not have network share drivers.


Dan Goodell wrote on Jun 23rd, 2012 at 1:55am:
Observation #6:

As designed, the script assumes that if it finds a D:\Windows directory, that D: refers to the second partition on the first HDD.That can't be guaranteed.It depends on the how many HDDs, their specific complement of primary vs extended partitions, and which of those might be FAT, FAT32, or NTFS.Remember, DOS gets to assign drive letters first before ntfs4dos.exe gets its hands on what's left.

Observation #7:

Syntax error in findG.bat, line: "if exist d:\windows GOTO part2".That DOS instruction does not check for a directory named windows, it checks for a file named windows.To check for a directory, use the syntax: "if exist d:\windows\nul GOTO part 2".



I am using windows 98se dos and when i run the batch it does not have DOS syntax error msg.
This coding is for situation of DELL, ACER laptop where
there is a hidden primary partition in disk1, volume1
c drive windows os  is in unhidden primary partition disk1, volume2

if exist d:\windows GOTO part2
echo ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:1 -FX
pause
ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:1 -FX
goto done

:part2
echo ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:2 -FX
pause
ghost.exe -CLONE,MODE=PLOAD,SRC=%drive2%\%ghofile%:1,DST=1:2 -FX

:done
 
 
IP Logged
 
NightOwl
Radministrator
*****
Offline


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

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


Back to top
Re: Auto ghost back the latest ghost and eject the cd
Reply #14 - Jun 23rd, 2012 at 2:28pm
 
@
an illusions

an illusions wrote on Jun 21st, 2012 at 6:06pm:
findcd.com--- find where the cd is located if you have more than one cd drive
FindCD v1.02, (c) 2000-2001, Bart Lagerweij
27 nov 2001, http://www.nu2.nu/contact/bart

This might be a better direct link to the above for downloading:

findcd.zip

For a description: 

FindCD


 

____________________________________________________________________________________________

No question is stupid ... but, possibly the answers are Wink !
 
IP Logged
 
Pages: 1 2 
Send Topic Print