We help IT Professionals succeed at work.

How to use the expand command in a batch file

   I am using VMware on a XP Pro machine.  I need to have a batch file OR some other way to expand the compressed files that I have copied to the dos directory in the DOS VM environment.  The old setup discs I have will not do the expansion during the setup phase of DOS.  I know I can do the compressed files one at a time but there has to be a better way.
     If someone could come up with a way to do it with out typing each command for the 100+ files that would be great. I have tried to create a batch file to do that, however I don't have enough batch file experience to do it and maybe it can"t be done.  I have no problem getting files into the dos directory in the VM environment.  SO if I need to do the expansion in XP that would be ok to.
      I am on a time table for this since it involves my job.
Thanks
Chet
Comment
Watch Question

jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
Something like

for /R d:\x386 %I in (*.*) do expand.exe %~fI

?

Author

Commented:
jkr:

Maybe does this run from a XP Pro cmd window or????

The compressed files are located in c:\1msdos6.2      On my XP Machine

and in c:\dos      on the VM

where do I run this at.  Sorry for the confusion on my part

Author

Commented:
I tried it in a simple batch file in the c:\1msdos6.2  directory     On my XP Machine don't laugh but this is the batch file I used from the command prompt in the directory
cls
for /R d:\x386 %I in (*.*) do expand.exe %~fI
end

Should I have run this from theVM ?
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
>>Should I have run this from theVM ?

Well, you should run it where you want to expand the files. Replace the 'd:\x386' part with where your files are, i.e.

for /R c:\dos %I in (*.*) do expand.exe %~fI

Author

Commented:
This is what I get when I run it

C:\dos>for /R c:\dos %I in (*.*) do expand.exe %~fI
C:\dos>expand.exe c:\dos\1.bat
Type the location and/or name you
want to give the expanded file.
(Example: C:\DOS\EGA.SYS)
Expanded file:

I am trying to get away from haveing to do each file individually  Wait Maybe If I put the files That I need decompressed in a seperate directory it will work.  hang in there and let me try that.

Author

Commented:
Nope that isn't right either

Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVABSI.DL_.

C:\1>expand.exe c:\1\MWAVDLG.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVDLG.DL_.

C:\1>expand.exe c:\1\MWAVDOSL.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVDOSL.DL_.

C:\1>expand.exe c:\1\MWAVDRVL.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVDRVL.DL_.

C:\1>expand.exe c:\1\MWAVMGR.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVMGR.DL_.

C:\1>expand.exe c:\1\MWAVSCAN.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVSCAN.DL_.

C:\1>expand.exe c:\1\MWAVSOS.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVSOS.DL_.

C:\1>expand.exe c:\1\MWAVTSR.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWAVTSR.EX_.

C:\1>expand.exe c:\1\MWBACKF.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWBACKF.DL_.

C:\1>expand.exe c:\1\MWBACKR.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWBACKR.DL_.

C:\1>expand.exe c:\1\MWBACKUP.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWBACKUP.EX_.

C:\1>expand.exe c:\1\MWBACKUP.HL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWBACKUP.HL_.

C:\1>expand.exe c:\1\MWGRAFIC.DL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWGRAFIC.DL_.

C:\1>expand.exe c:\1\MWUNDEL.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWUNDEL.EX_.

C:\1>expand.exe c:\1\MWUNDEL.HL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\MWUNDEL.HL_.

C:\1>expand.exe c:\1\NET.1X_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\NET.1X_.

C:\1>expand.exe c:\1\NET.TX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\NET.TX_.

C:\1>expand.exe c:\1\NETBEUI.DO_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\NETBEUI.DO_.

C:\1>expand.exe c:\1\NETWKSTA.1X_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\NETWKSTA.1X_.

C:\1>expand.exe c:\1\NETWKSTA.2X_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\NETWKSTA.2X_.

C:\1>expand.exe c:\1\NIBBLES.BA_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\NIBBLES.BA_.

C:\1>expand.exe c:\1\PACKING.LST
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\PACKING.LST.

C:\1>expand.exe c:\1\POWER.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\POWER.EX_.

C:\1>expand.exe c:\1\PRINT.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\PRINT.EX_.

C:\1>expand.exe c:\1\PRINTER.SY_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\PRINTER.SY_.

C:\1>expand.exe c:\1\QBASIC.HL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\QBASIC.HL_.

C:\1>expand.exe c:\1\RAMDRIVE.SY_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\RAMDRIVE.SY_.

C:\1>expand.exe c:\1\REDIR.1X_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\REDIR.1X_.

C:\1>expand.exe c:\1\REDIR.2X_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\REDIR.2X_.

C:\1>expand.exe c:\1\REMLINE.BA_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\REMLINE.BA_.

C:\1>expand.exe c:\1\REPLACE.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\REPLACE.EX_.

C:\1>expand.exe c:\1\RESTORE.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\RESTORE.EX_.

C:\1>expand.exe c:\1\SETNAME.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SETNAME.EX_.

C:\1>expand.exe c:\1\SETVER.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SETVER.EX_.

C:\1>expand.exe c:\1\SHARE.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SHARE.EX_.

C:\1>expand.exe c:\1\SIZER.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SIZER.EX_.

C:\1>expand.exe c:\1\SMARTDRV.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SMARTDRV.EX_.

C:\1>expand.exe c:\1\SMARTMON.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SMARTMON.EX_.

C:\1>expand.exe c:\1\SMARTMON.HL_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SMARTMON.HL_.

C:\1>expand.exe c:\1\SORT.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SORT.EX_.

C:\1>expand.exe c:\1\SUBST.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\SUBST.EX_.

C:\1>expand.exe c:\1\TREE.CO_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\TREE.CO_.

C:\1>expand.exe c:\1\VFINTD.38_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\VFINTD.38_.

C:\1>expand.exe c:\1\VGA.GR_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\VGA.GR_.

C:\1>expand.exe c:\1\VGA.VI_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\VGA.VI_.

C:\1>expand.exe c:\1\VGAMONO.GR_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\VGAMONO.GR_.

C:\1>expand.exe c:\1\VSAFE.CO_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\VSAFE.CO_.

C:\1>expand.exe c:\1\WINA20.38_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\WINA20.38_.

C:\1>expand.exe c:\1\WNTOOLS.GR_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\WNTOOLS.GR_.

C:\1>expand.exe c:\1\XCOPY.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

No destination specified for: c:\1\XCOPY.EX_.

C:\1>
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
Ah, sorry, make that

for /R c:\dos %I in (*.*) do expand.exe -r %~fI

The '-r' was what I forgot.

Author

Commented:
Almost, what it seems to be doing is changing for an example instead for making the file xcopy.exe it is making the file xcopy.ex  ( that is what shows in XP file manager this is what it shows in the XP DOS window.
C:\dos>expand.exe -r c:\dos\XCOPY.EX_
Microsoft (R) File Expansion Utility  Version 5.1.2600.0
Copyright (C) Microsoft Corp 1990-1999.  All rights reserved.

Copying c:\dos\xcopy.ex_ to c:\dos\xcopy.ex.
c:\dos\xcopy.ex_: 11093 bytes copied.

OH NO!
I just thought of something I am on my XP Pro computer I wonder if I go to the VM DOS it would make a difference.  Should I try it on the VM.


jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
>>xcopy.exe it is making the file xcopy.ex

OK, then add

ren *.ex *.exe

(and similar for other types)

Author

Commented:
I don't mean to disagree but what I didn't say is the xcopy.ex_ file is still there  and the sizes of all the files  .ex and .ex_  are the same so I don't think they converted.
The same is true of all the extensions of the other files like .cp and .cp_    .ov and .ov_     ETC.

Author

Commented:
I  My not get back to you with a reply until tomorrow I leave work In 10 Min.  4:30 PM EST.  The boss gets upset if I put in overtime.
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
No need to apologize, but

- email is refrained from solving EE Qs, see the EE help Q
- You can't get an answer from my admin address.

So, in short, what is going wrong (since I may not use any emailed information)?
   This is what I posted yesterday.  I want to thank you for all your help having said that I am more then willing to still award points for your work done.  I don't know what your policy is in situations like this if it is a lesser award of points or the full 500 I will comply either way because you did you best to help and most likely would have succeeded.
     I also included the screen shot in an attachment to show you what was happening in the decompression process. This is only a single column all the compressed converted the same way.
      I just had management ALL OVER my you know what and was able to work it out. As stated in the information I posted below.
01.30.2008 at 02:37PM EST, ID: 23124005
Title:
Automated Request for Deletion: Q_23120091
 Bookmark:
Question: Please attend to the following question:

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_23120091.html

My question is in 3 Zone(s).
My question has 4 Expert comment(s).

My reason is: Yes I found my own solution,  Well sort of.
I got to a old Doss 6.22 machine and downloaded the dos directory and then copied that to a CD, and then in the VMware machine I copied the uncompressed DOS files to the dos directory.  I then used the supplement disk to put the supplements in.  The end result I had a complete operating system in the dos 6.22 enviroment that ran the program that was custom created BC(Before Chet) back in 1989

I posted this request automatically using the "Request Deletion" feature.
Zone:
General Community Support
 Author:
scubaman1949, Limited Member
 Unknown on this subject. Report Abuse Delete Question Time Zone:
Eastern Standard Time (GMT-05:00)

example.jpg

Commented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator