Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Page Index Toggle Pages: 1
Send Topic Print
IF GOTO fails (Read 16585 times)
Brian
Demigod
******
Offline



Posts: 6345
NSW, Australia


Back to top
IF GOTO fails
Jul 16th, 2012 at 4:08pm
 
I need some help here. I'm trying to make a FreeDOS Drive Snapshot boot CD more user friendly. These lines don't work. If I choose N it doesn't goto negative.

set /p structure=Restore partitionstructure, Y or N?:
if /i "%structure%"=="N" goto negative
snapshot restore hd1 partitionstructure abc.sna
:negative

 
 
IP Logged
 

NightOwl
Radministrator
*****
Offline


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

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


Back to top
Re: IF GOTO fails
Reply #1 - Jul 17th, 2012 at 12:39pm
 
@
Brian

Did a little searching but did not find a usable answer.

Could you explain where the commands are coming from--they don't appear to be *DOS* commands--are they specific to the *Drive Snapshot* program?

What I don't understand--the first line is suggesting a *Y* or *N* keyboard response--but, I am unaware of the *set* command in DOS having a Y/N response associated with it?

And the second line--how is the *if /i "%structure%"==* looking for a Y/N keyboard response--again I'm unaware of how that looks for a keyboard Y/N response?
 

____________________________________________________________________________________________

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



Posts: 6345
NSW, Australia


Back to top
Re: IF GOTO fails
Reply #2 - Jul 17th, 2012 at 3:29pm
 
@
NightOwl

Thanks for your comments. I got the ideas from here...

http://ss64.com/nt/set.html

Strangely, those lines work in a FreeDOS HD partition and in a Command Window in Windows. But not from the FreeDOS CD.


Edit... Try this batch file in a Command Window.

@echo off
set /p structure=Restore partitionstructure, Y or N?:
echo.
if /i "%structure%"=="N" goto negative
echo You chose Y
pause
exit
::snapshot restore hd1 partitionstructure abc.sna
:negative
echo You chose N
pause
 
 
IP Logged
 
NightOwl
Radministrator
*****
Offline


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

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


Back to top
Re: IF GOTO fails
Reply #3 - Jul 18th, 2012 at 8:44am
 
@
Brian

Tried the batch file--worked as advertised--on my system.

Quote:

Hmmmm....obviously, I've been using the *DOS for dummies* resources--there are some advanced DOS syntax commands that I didn't know existed  Smiley !

Quote:
Strangely, those lines work in a FreeDOS HD partition and in a Command Window in Windows. But not from the FreeDOS CD.

Had to think about that--and it finally dawned on me--I bet the *set* command has to *write* to where ever the *environment* variables are kept--and I suspect that is to the drive of record that's being booted from--i.e. the virtual floppy drive A:--which can't be written to.

Same problem you have when Ghost 2003 has an error and wants to write the *ghosterr.txt* file to A:.  And the same problem when you use a DOS boot disc that needs to *discover* the network card being used on a system--those programs need to write a *.ini* file for the network drivers once it finds the network card--and that fails too--can't write to the virtual floppy drive.

The work around that I've seen is creating a RAM drive, transferring the boot files to that, and continuing the booting from there--now the write to the RAM drive succeeds!

I'm not exactly sure--but, I'm guessing that is the problem.
 

____________________________________________________________________________________________

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


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

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


Back to top
Re: IF GOTO fails
Reply #4 - Jul 18th, 2012 at 10:26am
 
@
Brian

Just thought of another possibility--instead of a RAM drive, you might be able to use a *RAM Floppy Drive* program. 

It comes with the download for the *Panasonic* DOS USB drivers--it's called *RAMFD.SYS*.

It's there so you can boot and load the DOS USB drivers from a floppy USB drive and not have it over-write the USB controller's access to the USB floppy drive when it *resets* the USB controller that is accessing the floppy drive.

I played around with it--seemed to work well--I've never had need to use it so I haven't for a long time--if I recall correctly--you have to load it from the config.sys before any program that needs it--and the booting continues, and the RAM Floppy drive still retains the A: drive letter designation.

Hmmm....tried the various links I have to the Japanese Panasonic downloads and they no longer go to the actual download anymore--get a *generic* download page that's in Japanese.  I'll have to upload the file to Radified.  That will take me a little while--have to fire up a different computer.

Okay, found a valid link:  http://panasonic.jp/com/support/drive/archive/f2h/f2h_usb.exe

After clicking on the downloaded *.exe* file which extracts the enclosed files, you will find the *RAMFD.SYS* file in the *F2h* subdirectory. 

 

____________________________________________________________________________________________

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



Posts: 6345
NSW, Australia


Back to top
Re: IF GOTO fails
Reply #5 - Jul 18th, 2012 at 4:54pm
 
@
NightOwl

Thanks for the assistance. Writing to the disk is a good thought but the CD does use a RAM drive. So I gave up trying to get it to work and I'm now using choice.exe which works. The ISO is almost "full" as there is only 2 KB of free space remaining.

The purpose of this exercise was to help someone create a Drive Snapshot restore CD where he only had to enter the name of the relevant backup image. No other input. The CD finds the image store folder.
 
 
IP Logged
 

Brian
Demigod
******
Offline



Posts: 6345
NSW, Australia


Back to top
Re: IF GOTO fails
Reply #6 - Jul 20th, 2012 at 3:51pm
 
I'm not working on this CD anymore but if anyone would like to play with it, here is the download from the Drive Snapshot site...

http://www.drivesnapshot.de/download/snapboot.iso
 
 
IP Logged
 
NightOwl
Radministrator
*****
Offline


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

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


Back to top
Re: IF GOTO fails
Reply #7 - Jul 21st, 2012 at 8:43am
 
@
Brian

Brian wrote on Jul 18th, 2012 at 4:54pm:
Writing to the disk is a good thought but the CD does use a RAM drive. So I gave up trying to get it to work

Just to be clear, just because a RAM drive is created, does not *solve* the problem!  You have to either move the boot files to the RAM drive to complete the boot process (you might need to use a shell command to point to the RAM drive), or at least copy *command.com* to the RAM drive, and use a shell command line in config.sys to point to the RAM drive to find command.com there.  That will then be where any changes to the environment variables, like the set command, will be kept and looked for going forward with the boot process.

I have not done the above--never have had the need, but I've seen it mentioned for other reasons as mentioned above.  So, there might be other steps involved--but, the general outline, I think, points in the right direction.
 

____________________________________________________________________________________________

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



Posts: 6345
NSW, Australia


Back to top
Re: IF GOTO fails
Reply #8 - Jul 21st, 2012 at 5:11pm
 
@
NightOwl

I think you have the correct answer. Here is a section from autoexec.bat...

Code:
rem The ramdisk drive
set ramdrv=q:
xmsdsk 8192 %ramdrv% /y /t
if errorlevel 1 goto _ramok
rem xmsdsk returns errorlevel 0 for error
goto _abort
:_ramok

md %ramdrv%\temp
set temp=%ramdrv%\temp
set tmp=%ramdrv%\temp

copy \command.com %ramdrv%\command.com
if not exist %ramdrv%\command.com goto _abort
set comspec=%ramdrv%\command.com

copy snapshot.exe %ramdrv%\.

md %ramdrv%\bin
copy \bin\unuharc.exe %ramdrv%\bin
copy \bin\_unpack.bat %ramdrv%\bin

set path=%ramdrv%\;%ramdrv%\bin;%path%

call _unpack \level0\utils %ramdrv%\bin


There is nothing in config.sys relating to the RAM drive.
 
 
IP Logged
 
NightOwl
Radministrator
*****
Offline


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

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


Back to top
Re: IF GOTO fails
Reply #9 - Jul 25th, 2012 at 9:49am
 
@
Brian

Code:
copy \command.com %ramdrv%\command.com
if not exist %ramdrv%\command.com goto _abort
set comspec=%ramdrv%\command.com

That coding sure looks like it is copying the command.com to the RAM drive, and setting it as the location of command.com. 

Where were you putting the *set* code:  *set /p structure=Restore partitionstructure, Y or N?:*?  In config.sys or autoexec.bat?  Before or after the above code lines?
 

____________________________________________________________________________________________

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



Posts: 6345
NSW, Australia


Back to top
Re: IF GOTO fails
Reply #10 - Jul 25th, 2012 at 5:01pm
 
@
NightOwl

In autoexec.bat, below the above code. Don't spend any time on this if you have other things to do. I'm using choice.exe now.

As I mentioned above, the autoexec.bat works from a FreeDOS HD partition and in a Command Window in Windows. But not from the FreeDOS CD.
 
 
IP Logged
 

NightOwl
Radministrator
*****
Offline


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

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


Back to top
Re: IF GOTO fails
Reply #11 - Jul 26th, 2012 at 9:51am
 
@
Brian

Quote:
In autoexec.bat, below the above code.

Interesting--because it looks like the *command.com* has been transferred to the RAM drive and set as the default command interpreter--seems like it should be where the environment is being controlled--and *set* commands stored--looks like it should work--but, based on your experience--obviously it's not!

Quote:
Don't spend any time on this if you have other things to do.

Oh, not spending *huge* amount of time on this--just dabbling out of curiosity.




 

____________________________________________________________________________________________

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