Link to home
Start Free TrialLog in
Avatar of scubaman1949
scubaman1949

asked on

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
Avatar of jkr
jkr
Flag of Germany image

Something like

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

?
Avatar of scubaman1949
scubaman1949

ASKER

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
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 ?
>>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
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.
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>
Ah, sorry, make that

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

The '-r' was what I forgot.
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.


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

OK, then add

ren *.ex *.exe

(and similar for other types)
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.
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.
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)?
ASKER CERTIFIED SOLUTION
Avatar of scubaman1949
scubaman1949

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator