|
Answer» OK, now i GOT it working all the way to the unrar-ing... how can i add unrar.exe to the batch file? I installed unrar.exe (from winrar page) to program files, but i PROBABLY still need to add it to some library, or? woohoo got it working thanx for the help.
the script looks like this:
Code: [Select]for /F "delims=." %%R in ('dir /b U:\Archive_200803*.rar') do ( MD "C:\test\%%~nR" unrar X "U:\%%R" FolderB\File.bak move FolderB\File.bak "C:\test\%%~nR" rd FolderB ) and i had to add the unrar.exe path to MyComputer settings (My Computer -> properties -> Advanced -> Environment Variables -> System variables / Path)Code: [Select]:: MD "C:\test\%%~nR" for /F "delims=." %%R in ('dir /b U:\Archive_200803*.rar') do unrar e "U:\%%R" FolderB\File.bak "C:\test\%%~nR" 1st post
Since I just finished getting a batch script working to unrar password-encrypted RAR files, I knew there was an easier way... even if this thread is old, it COULD help others.
The make directory MD is not necessary since original poster SAID it would exist. As well, the previous code example was creating and destroying directories each time for each archive that it found... makes everything slow and was not necessary... only needed before and after for loop.
For my example, you can extract the file directly without the tree structure by using "unrar e" instead of "unrar x", and you can also specify the output directory as the last parameter.
Enjoy!
|