Jump to content

Recommended Posts

Posted

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.


Posted

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

Posted (edited)

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
Posted

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.

Posted (edited)

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
Posted (edited)
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
  • 1 month later...
  • 2 months later...
  • 1 year later...
Posted

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...