r3al1ty Posted October 8, 2005 Share Posted October 8, 2005 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. Link to comment Share on other sites More sharing options...
Yzöwl Posted October 8, 2005 Share Posted October 8, 2005 In a cmd window, navigate to the directory and use the folllowing commandexpand -r ?*.?*_ Link to comment Share on other sites More sharing options...
r3al1ty Posted October 8, 2005 Author Share Posted October 8, 2005 Thank you, it worked like a dream B) Link to comment Share on other sites More sharing options...
Xable Posted October 8, 2005 Share Posted October 8, 2005 (edited) 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, 2005 by Neanderthal Link to comment Share on other sites More sharing options...
Yzöwl Posted October 8, 2005 Share Posted October 8, 2005 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 Link to comment Share on other sites More sharing options...
zorro1 Posted October 8, 2005 Share Posted October 8, 2005 Expand and del *.**_for %%U in (*.**_) DO (expand -r %%U del %%U) Link to comment Share on other sites More sharing options...
Yzöwl Posted October 8, 2005 Share Posted October 8, 2005 sorry zorro1, doesn't work Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 8, 2005 Share Posted October 8, 2005 (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.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, 2010 by gunsmokingman Link to comment Share on other sites More sharing options...
Xable Posted October 8, 2005 Share Posted October 8, 2005 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. Link to comment Share on other sites More sharing options...
Yzöwl Posted October 8, 2005 Share Posted October 8, 2005 (edited) 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, 2005 by Yzöwl Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 8, 2005 Share Posted October 8, 2005 Edit cannot find image Link to comment Share on other sites More sharing options...
Xable Posted October 9, 2005 Share Posted October 9, 2005 (edited) 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, 2005 by Neanderthal Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted November 20, 2005 Share Posted November 20, 2005 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. Link to comment Share on other sites More sharing options...
gunsmokingman Posted January 30, 2006 Share Posted January 30, 2006 (edited) Vb.net need to be installedUpdated ApplicationSource Code Edited May 15, 2010 by gunsmokingman Link to comment Share on other sites More sharing options...
gunsmokingman Posted July 30, 2007 Share Posted July 30, 2007 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now