Hi all. tn messing again and once again in need of some pointers. What I am trying to do is compress some drivers. I have this script This does one file and I have to use "RUN"... What I would like to know is how to write it so ALL the files in a particular fo;der,say C:\XP\1 are compressed and end up in anotheer folder,say C:\XP\2 I have tried *.* but it dont work ??? And how do I script it to become a .bat or .cmd so I can just click on it to start it going.. Hope this makes sence. Scripting is probebly my weak point... Any tips or advice would be very welcome.. Cheers
Would that not just make one big file. I would like to make each file seperately.... Will have a look at it though Cheers..
Right I have that copied.... Exactly how will this work....Sorry.. would it be What I dont understand is,how does this point to a particular folder ? Do i save it as .cmd,copy this file into my chosen folder with the files in it and run the .cmd ?? Thanks though... off to try it..
ok.. found this bit of script and it sort of works What it needed though was for the makecab.exe to be in the same folder as the .cmd file. This then did sort of work and made all the files in C:\XP\1 into files with the ext "._",compressed. So what do you make of that code ? How would I change it then so the compressed files ended up into the folder of my choice ? I dont confess to know what %%a means.... cheers..
Better at than me i bet...... Thanks for the help though... Hopefull a scripting expert will spot this thread and give some pointers..
Use the /L switch to save to location you want ie: Code: cd %~dp0 & for %%a in (*.*) do makecab %%a /L "Save to location" >nul Not tried it but it should work. Command prompt > makecab /? for list of switches Cabpack is a useful tool http://www.larshederer.homepage.t-online.de/cabpack.htm
Thanks Alphawaves.. Time getting too close for work so i will look at this closer tomorrow arfo when I arise.. If my memory serves me well,I believe you once helped me out a good while back now.. Thanks for the info...
Well I do believe I have got,I would say 90% of what I want.. Let me go through it. I made a folder in C: called "Makecab" In here I have the makecab.exe Two folders, "Files" and "Compressed" I have my little .cmd with this script So with a little digging on the net from the other day and help from here it is doing what I want. Put the original driver files into "Files" run the .cmd and ALL the files are compressed and end up in "Compressed" @Alpahawaves.. Thanks once again. I took the last part of your script and married it to the begining of what I had and voila. two things though, "CD" at the satrt of your code and ">nul" at the end,what were these doing ? I like how leaving >nul out and leaving the pause in I can clearly see it has worked. Cheers... @Tito.. Thanks mate It makes me wonder now. Could I be clever enough to make some sort of GUI where a user could navigate to and folder holding the driver files and then select any folder or have it make a new folder containing the compressed files.. mmmmmmmmmmmmmmmm......May just look into this. i have messed with IndigoRose AutoPlay media in the past. it may help.. Cheers guys.....
Been testing it and it is working like a charm...Love it.. Also thought I would add a "Clear Folders" .cmd file. One click and the files are deleted. Works pretty well too. cant make up my mind if I like having the pause in or not...No big deal.
Now i just can't stop my self. I have made another little .cmd file when placed inside a folder containing all the files I want to be copied to "Makecab" \nd run all the files are copied over,no navigating to be done.. It sort of works apart from one major fault,it copies it's self too. I do not want this. So can i ask how do you amend the code to tell it not to copy it's self. the .cmd file name is maybe to go one setp further to delete it's self as well...Ohh can that be done.... OMG...Nar hate text talk....OH MY GOD.. Right I have made a few different .cmd's to do various tasks. Can all these be combined into just one .cmd so when it's run all the tasks are done.....ohh sounds tricky...
Well been messing,even more and now I have this script I like it.. I put my "Copy Files to makecab.cmd" into the folder with the files I want to compress. Run the .cmd. It copies all the files to Makecab\Files but does not copy it's self. It then opens the folder Makecab and deletes its self from the original driver folder I put it in. i run the "Makecab.cmd" and all the files are compressed and end up in Makecab\Compressed. Quite pleased with my self to ne honest...
Cool glad you got it sorted One thing tho i dont think you need to add the attributes to the .cmd file as xcopy will not copy a .cmd file in use (.bat will do tho) ie: Code: @echo off cd /d %~dp0 & xcopy /y /w . C:\Makecab\Files pause explorer "C:\Makecab\Files" del "%~f0" && exit Also del "%~f0" && exit may work better in a .bat file EDIT Sorry i missed your previous comment: >nul = hides current output cd %~dp0 = Sets your current directory to the directory you have the .cmd/makecab/xcopy file in etc..
Cheers for that info Alphawaves.... Will look at your codes properly later on. just on the old lappy right now.
Hi ya.. I save your new code as a .bat and a .cmd They both copy themselves into the "Files" folder... It has me thinking though how I could make things simpler..mmmmmmmm
How about putting all files apart from batch file into a folder inside your working folder. .bat: Code: @echo off cd /d %~dp0 & xcopy /y /w Myfolder\. C:\Makecab\Files pause explorer "C:\Makecab\Files" del "%~f0" && exit