FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » batch command help...

   
Author Topic: batch command help...
lem
Member
Member # 6914

 - posted      Profile for lem           Edit/Delete Post 
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

Posts: 2445 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
Swampjedi
Member
Member # 7374

 - posted      Profile for Swampjedi   Email Swampjedi         Edit/Delete Post 
batch file x.bat:

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

command:

x "dll file"

Posts: 1069 | Registered: Feb 2005  |  IP: Logged | Report this post to a Moderator
Swampjedi
Member
Member # 7374

 - posted      Profile for Swampjedi   Email Swampjedi         Edit/Delete Post 
Moral: use %1...%n to refer to command line arguments.
Posts: 1069 | Registered: Feb 2005  |  IP: Logged | Report this post to a Moderator
TomDavidson
Member
Member # 124

 - posted      Profile for TomDavidson   Email TomDavidson         Edit/Delete Post 
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]

Posts: 37449 | Registered: May 1999  |  IP: Logged | Report this post to a Moderator
lem
Member
Member # 6914

 - posted      Profile for lem           Edit/Delete Post 
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!

Posts: 2445 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
Swampjedi
Member
Member # 7374

 - posted      Profile for Swampjedi   Email Swampjedi         Edit/Delete Post 
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.
Posts: 1069 | Registered: Feb 2005  |  IP: Logged | Report this post to a Moderator
TomDavidson
Member
Member # 124

 - posted      Profile for TomDavidson   Email TomDavidson         Edit/Delete Post 
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.

Posts: 37449 | Registered: May 1999  |  IP: Logged | Report this post to a Moderator
lem
Member
Member # 6914

 - posted      Profile for lem           Edit/Delete Post 
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.

Posts: 2445 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
lem
Member
Member # 6914

 - posted      Profile for lem           Edit/Delete Post 
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!*

Posts: 2445 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
lem
Member
Member # 6914

 - posted      Profile for lem           Edit/Delete Post 
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.

Posts: 2445 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
Swampjedi
Member
Member # 7374

 - posted      Profile for Swampjedi   Email Swampjedi         Edit/Delete Post 
Thanks Tom - I was in a hurry. I didn't think to add the <dll> again, since I had it before [Wink]
Posts: 1069 | Registered: Feb 2005  |  IP: Logged | Report this post to a Moderator
Topher
Member
Member # 9028

 - posted      Profile for Topher   Email Topher         Edit/Delete Post 
or just download a cracked copy of 98se.
Posts: 33 | Registered: Jan 2006  |  IP: Logged | Report this post to a Moderator
xnera
Member
Member # 187

 - posted      Profile for xnera   Email xnera         Edit/Delete Post 
And for future reference, doskey is the utility that lets you use the up arrow to retrieve commands from history.
Posts: 1805 | Registered: Jun 1999  |  IP: Logged | Report this post to a Moderator
TomDavidson
Member
Member # 124

 - posted      Profile for TomDavidson   Email TomDavidson         Edit/Delete Post 
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.

Posts: 37449 | Registered: May 1999  |  IP: Logged | Report this post to a Moderator
Icarus
Member
Member # 3162

 - posted      Profile for Icarus   Email Icarus         Edit/Delete Post 
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?
Posts: 13680 | Registered: Mar 2002  |  IP: Logged | Report this post to a Moderator
lem
Member
Member # 6914

 - posted      Profile for lem           Edit/Delete Post 
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]

Posts: 2445 | Registered: Oct 2004  |  IP: Logged | Report this post to a Moderator
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

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