Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

How to expand multiple files?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
14 replies to this topic

#1
r3al1ty

r3al1ty

    Newbie

  • Member
  • 26 posts
  • Joined 06-August 05
How to I use expand command for a directory. I want to expand all files that are in i386 folder but I don't want to manually do this.


How to remove advertisement from MSFN

#2
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,071 posts
  • Joined 13-October 04
In a cmd window, navigate to the directory and use the folllowing commandexpand -r ?*.?*_


#3
r3al1ty

r3al1ty

    Newbie

  • Member
  • 26 posts
  • Joined 06-August 05
Thank you, it worked like a dream B)

#4
Xable

Xable

    XUDPack

  • Member
  • PipPip
  • 201 posts
  • Joined 23-November 04
Found this code a while back, credit to whoever made it.

It will Expand then delete all the compressed files in the folder it`s run from.

Attached Files


Edited by Neanderthal, 08 October 2005 - 08:51 AM.


#5
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,071 posts
  • Joined 13-October 04
Just thought I'd mention a problem with the above batch file download. If an error occurs which prevents any of the files from expanding, the compressed file will be deleted too. This batch file will be more efficient
@echo off

for %%a in (?*.?*_) do expand -r %%a >nul 2>&1&&del /q %%a


#6
zorro1

zorro1

    Member

  • Member
  • PipPip
  • 124 posts
  • Joined 02-November 03
Expand and del *.**_

for %%U in (*.**_) DO (expand -r %%U del %%U)

#7
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,071 posts
  • Joined 13-October 04
sorry zorro1, doesn't work

#8
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,240 posts
  • Joined 02-August 03
This expands and than ask if you want to keep the Archive files.
Place this in the folder you would like to expand.
Save as Expand.cmd

ECHO OFF && cls && color f2 && mode 65,9
Title EXPAND Archive
set RT=%CD%
:::::::Clean Up
Set Mkvbs=MkcabCleanup.vbs
> %Mkvbs% Echo Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
>> %Mkvbs% Echo If Fso.FileExists("MKdel.cmd") Then
>> %Mkvbs% Echo Fso.deletefile("MKdel.cmd")
>> %Mkvbs% Echo If Fso.FileExists("MKdel.cm_") Then
>> %Mkvbs% Echo Fso.deletefile("MKdel.cm_")
>> %Mkvbs% Echo End If
>> %Mkvbs% Echo End If
>> %Mkvbs% Echo If Fso.FileExists("ExpandArch.cmd") Then
>> %Mkvbs% Echo Fso.deletefile("ExpandArch.cmd")
>> %Mkvbs% Echo If Fso.FileExists("ExpandArch.cm_") Then
>> %Mkvbs% Echo Fso.deletefile("ExpandArch.cm_")
>> %Mkvbs% Echo End If
>> %Mkvbs% Echo End If
>> %Mkvbs% Echo If Fso.FileExists("MkcabCleanup.vbs") Then
>> %Mkvbs% Echo Fso.deletefile("MkcabCleanup.vbs")
>> %Mkvbs% Echo End If
>> %Mkvbs% Echo If Fso.FileExists("Archive") Then
>> %Mkvbs% Echo Fso.deletefile("Archive")
>> %Mkvbs% Echo End If
:::::::Begins Extract Process
mkdir "%RT%\Archive"
for %%i in ("%RT%\*.*") do EXPAND *.*_ /R && Move *.*_ "%RT%\Archive" && ping -n 1 127.0.0.1>nul
ping -n 1 127.0.0.1>nul
Cls && mode 50,9 && Color f1 && Echo. && Echo Would You Like To Keep The Archive? && Echo.
Echo Yes To Keep The Archive && Echo. && Echo No To Delete The Archive && Echo.
Set /P Choice= Yes To Keep No To Delete :-^>
Goto %Choice%
:NO && Cls && Title Remove %RT%\Archive
del /s /q "%RT%\Archive\*.*_"
ping -n 1 127.0.0.1>nul
Rmdir /s /q "%RT%\Archive"
ping -n 1 127.0.0.1>nul
Echo. && Echo %RT%\Archive && Echo Removed && Ping -3 127.0.0.0.1>nul && Goto Quit
:Yes && Cls && Title Keeping %RT%\Archive
Echo. && Echo keeping && Echo %RT%\Archive && copy /y ExpandArch.cmd "%RT%\Archive" && Ping -3 127.0.0.0.1>nul && Goto Quit
:Quit
Echo Goodbye
Start /w %Mkvbs%
ping -n 3 127.0.0.1>nul && exit

Vb.net need to be installed
Updated Application
Source Code

Edited by gunsmokingman, 15 May 2010 - 04:07 PM.



GunSmokingMan



#9
Xable

Xable

    XUDPack

  • Member
  • PipPip
  • 201 posts
  • Joined 23-November 04
Yzöwl, thanxs that`s better... nice and simple. few things,

if the file is read only it will extract but not delete
if the file is hidden it will not extract or delete

possible to clear attributes before expand and delete?

gunsmokingman, the cmd expands but doesn`t ask if you want to keep the Archive files.

#10
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,071 posts
  • Joined 13-October 04
You would have to change it to something like this, (untested)
@echo off

for /f "delims=" %%a in ('dir/b/a "*.?*_"') do expand -r %%~nxa >nul 2>&1&&del /f/a/q %%a
Just drop it in the directory and double click it.

Edited by Yzöwl, 08 October 2005 - 02:28 PM.


#11
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,240 posts
  • Joined 02-August 03
Edit cannot find image


GunSmokingMan



#12
Xable

Xable

    XUDPack

  • Member
  • PipPip
  • 201 posts
  • Joined 23-November 04

You would have to change it to something like this, (untested)

@echo off
for /f "delims=" %%a in ('dir/b/a "*.?*_"') do expand -r %%~nxa >nul 2>&1&&del /f/a/q %%a
Just drop it in the directory and double click it.

excellant works perfect :)

gunsmokingman, still not workin, it`s probably my box though i need a reinstall. ;)

EDIT
Yzöwl could the batch be made to go through sub folders aswell? that would be special. ;)

Edited by Neanderthal, 09 October 2005 - 06:13 PM.


#13
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,706 posts
  • Joined 18-September 03
OK here goes I too the code provided by Yzowl and compiled it into a stand alone app.

Expand-Delete

I really like this and have found it very usefull.

#14
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,240 posts
  • Joined 02-August 03
Vb.net need to be installed
Updated Application
Source Code

Edited by gunsmokingman, 15 May 2010 - 04:07 PM.



GunSmokingMan



#15
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,240 posts
  • Joined 02-August 03
Sorry for bringing up a old post, but I notice that I have had over 600 dl of my Makecab, I would
like to Thank everyone who has downloaded this. So I have updated that app and have added
a Expand cmd to it. So you can now you can just extract MakeCab files also with this app.
Thanks
Gunsmokingman
Vb.net need to be installed
Updated Application
Source Code


GunSmokingMan