This is topic batch command help... in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=040680

Posted by lem (Member # 6914) on :
 
I need to reinstall a bunch of dll fileson a 98se machine. I am not sure how many, I have already done 7. The problem is my son destroyed my 98 disk. He's 18 months and death on Cds!

I found a computer with the windows file saved on the C drive, but everything is in CAB files. I saved the files on a CD and have been extracting the files like this in DOS.

d:
cd \98_windows\win98se
d:\98_winodows\win98se (this is the path to those CAB files.
I then run the command:
extract /a /l c:\windows\options\cabs base4.cab "dll name"
That command is doing wonders of extractign the file and placing it in the right directory. BUT I HATE RETYPING IT EVERYSINGLE TIME.

For some reason after the extraction, the up arrow is not working for bringing back my last command. So I was wondering if I can make a batch file that will make my DOS look like this

quote:
d:\98_windows\win98se>extract /a /l c:\windows\options\cabs base4.cab
If it is set to that, then I only need to type in the dll file name. I can make echo's in batch, but that does not place the text in the prompt.

Or is there a way I can bring up my last command that does not use the arrow keys?

Thank you so very much!

EDITED for clarity
 
Posted by Swampjedi (Member # 7374) on :
 
batch file x.bat:

extract /a /l c:\windows\options\cabs\base4.cab %1

command:

x "dll file"
 
Posted by Swampjedi (Member # 7374) on :
 
Moral: use %1...%n to refer to command line arguments.
 
Posted by TomDavidson (Member # 124) on :
 
In Windows 98, there's no EASY way to pipe directory listings into a command.

That said, it IS possible to do so. It's also possible for you to create a text file containing just the filenames you need, and then pipe them into a batch file.

Specifically, you're going to do a FOR loop in the batchfile. Within that loop, you'll pipe each filename into the command string, execute the command, and repeat.

--------

Or, since you're probably going to have to type each .dll at least once ANYWAY, you can use swampjedi's clever shortcut. [Smile]
 
Posted by lem (Member # 6914) on :
 
So, I open my test editor and type:
quote:
batch file x.bat:

extract /a /l c:\windows\options\cabs\base4.cab %1

command:

and save it as a batch file. Then I run it and replace the "x" with the name of the file I am extracting?

Thanks btw..you are very fast!
 
Posted by Swampjedi (Member # 7374) on :
 
Tom's idea is better, but isn't exactly what you asked. Much more efficient. [Smile]

No, just type the middle line.

code:
extract /a /l c:\windows\options\cabs\base4.cab %1

and save it in a file x.bat. Then your command is x.
 
Posted by TomDavidson (Member # 124) on :
 
Not quite.

1) Open your text editor.
2) Type "extract /a /l c:\windows\options\cabs\base4.cab %1"
3) Save the open file as "x.bat"
4) Close your text editor.
5) From within the same directory as x.bat, type "x <dll name>" to unpack one .dll.
 
Posted by lem (Member # 6914) on :
 
The most I have ever done in Batch is

HI
press space bar
My name is Lee
I like Pizza.

I am looking for good study aids to practice batch files and understand some of these comments. So far I have found this site.
 
Posted by lem (Member # 6914) on :
 
quote:

Not quite.

1) Open your text editor.
2) Type "extract /a /l c:\windows\options\cabs\base4.cab %1"
3) Save the open file as "x.bat"
4) Close your text editor.
5) From within the same directory as x.bat, type "x <dll name>" to unpack one .dll.

AHHHHHHHhhh! Ok, that makes sense!
*runs off to other computer to try this out!*
 
Posted by lem (Member # 6914) on :
 
quote:
Tom's idea is better, but isn't exactly what you asked. Much more efficient. [Smile]
quote:
That said, it IS possible to do so. It's also possible for you to create a text file containing just the filenames you need, and then pipe them into a batch file.
It sounds like a better way, but I have to do it like Swampjedi because I don't know all the files I need.

I installed hardware and it is asking for dll files one at a time. Windows98se wants me to put in the disk, but I don't have the disk, so I have to extract them one at a time. grr... But this advice is VERY helpful and I am off to try it now.
 
Posted by Swampjedi (Member # 7374) on :
 
Thanks Tom - I was in a hurry. I didn't think to add the <dll> again, since I had it before [Wink]
 
Posted by Topher (Member # 9028) on :
 
or just download a cracked copy of 98se.
 
Posted by xnera (Member # 187) on :
 
And for future reference, doskey is the utility that lets you use the up arrow to retrieve commands from history.
 
Posted by TomDavidson (Member # 124) on :
 
Wait a sec. You're doing this as part of a hardware install?

If so, why not -- when it tells you to insert the 98SE disk -- just browse to the folder that holds your install CABs? That should have exactly the same effect.
 
Posted by Icarus (Member # 3162) on :
 
quote:
Or is there a way I can bring up my last command that does not use the arrow keys?

A million years ago, F3 used to do it. I guess this doesn't work anymore?
 
Posted by lem (Member # 6914) on :
 
It worked It worked!

I feel like Dora. "I did it! I did it! I did I did I did it!!!!!"

Of course, not without everyone's help here! Thank you so very much.
[Party]
 


Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2