October 8, 200520 yr 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.
October 8, 200520 yr In a cmd window, navigate to the directory and use the folllowing commandexpand -r ?*.?*_
October 8, 200520 yr 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 October 8, 200520 yr by Neanderthal
October 8, 200520 yr 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 offfor %%a in (?*.?*_) do expand -r %%a >nul 2>&1&&del /q %%a
October 8, 200520 yr 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.cmdECHO OFF && cls && color f2 && mode 65,9Title EXPAND Archive set RT=%CD%:::::::Clean UpSet 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 Processmkdir "%RT%\Archive"for %%i in ("%RT%\*.*") do EXPAND *.*_ /R && Move *.*_ "%RT%\Archive" && ping -n 1 127.0.0.1>nulping -n 1 127.0.0.1>nulCls && 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%\Archivedel /s /q "%RT%\Archive\*.*_"ping -n 1 127.0.0.1>nulRmdir /s /q "%RT%\Archive"ping -n 1 127.0.0.1>nulEcho. && Echo %RT%\Archive && Echo Removed && Ping -3 127.0.0.0.1>nul && Goto Quit:Yes && Cls && Title Keeping %RT%\ArchiveEcho. && Echo keeping && Echo %RT%\Archive && copy /y ExpandArch.cmd "%RT%\Archive" && Ping -3 127.0.0.0.1>nul && Goto Quit:QuitEcho GoodbyeStart /w %Mkvbs%ping -n 3 127.0.0.1>nul && exitVb.net need to be installedUpdated ApplicationSource Code Edited May 15, 201016 yr by gunsmokingman
October 8, 200520 yr Yzöwl, thanxs that`s better... nice and simple. few things,if the file is read only it will extract but not deleteif the file is hidden it will not extract or deletepossible to clear attributes before expand and delete?gunsmokingman, the cmd expands but doesn`t ask if you want to keep the Archive files.
October 8, 200520 yr You would have to change it to something like this, (untested)@echo offfor /f "delims=" %%a in ('dir/b/a "*.?*_"') do expand -r %%~nxa >nul 2>&1&&del /f/a/q %%aJust drop it in the directory and double click it. Edited October 8, 200520 yr by Yzöwl
October 9, 200520 yr You would have to change it to something like this, (untested)@echo offfor /f "delims=" %%a in ('dir/b/a "*.?*_"') do expand -r %%~nxa >nul 2>&1&&del /f/a/q %%aJust 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. EDITYzöwl could the batch be made to go through sub folders aswell? that would be special. Edited October 10, 200520 yr by Neanderthal
November 20, 200520 yr OK here goes I too the code provided by Yzowl and compiled it into a stand alone app.Expand-DeleteI really like this and have found it very usefull.
January 30, 200620 yr Vb.net need to be installedUpdated ApplicationSource Code Edited May 15, 201016 yr by gunsmokingman
July 30, 200719 yr 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 addeda Expand cmd to it. So you can now you can just extract MakeCab files also with this app. Thanks GunsmokingmanVb.net need to be installedUpdated ApplicationSource Code
Create an account or sign in to comment