• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Sign in to follow this  
Followers 0
r3al1ty

How to expand multiple files?

15 posts in this topic

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.

0

Share this post


Link to post
Share on other sites

In a cmd window, navigate to the directory and use the folllowing command

  • expand -r ?*.?*_

0

Share this post


Link to post
Share on other sites

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.

Expand_delete_Compressed_Files.rar

Edited by Neanderthal
0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Expand and del *.**_

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

0

Share this post


Link to post
Share on other sites

sorry zorro1, doesn't work

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites
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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.