Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing WINRAR with batch script
    primarykey
    data
    text
    <p>I am new to scripting, can some please assist me,</p> <p>I have batch file that</p> <ol> <li>Looks at the first 8 characters in the file name, creates and moves those files to new folder with first 8 characters as folder name. </li> <li>Then looks at folder created in step 1 for next four series of character (9,10,11,12)and create and move to another subfolder with next 4 characters as folder name.</li> <li>Then looks at folder created in step 2, for extension of every file and create and move to a new folder with extension as folder name.</li> </ol> <p>For example, I have files that look like this</p> <pre><code>ABCEFGHI0703xyz.pdf STUVWXYZ0805xyz.pptx </code></pre> <p>Move to folder</p> <pre><code>ABCEFGHI\0703\PDF STUVWXYZ\0805\PPTX </code></pre> <p>Keeping in mind first 8 characters are random, next 4 character are year and month, and 9 types of extensions.</p> <p>I am using this batch script to create these folders:-</p> <pre><code>@ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET "sourcedir=C:\sourcedir" SET "destdir=C:\sourcedir" FOR /f "delims=" %%a IN ( 'dir /b /a-d "%sourcedir%\*" ' ) DO ( SET name=%%~na SET ext=%%~xa SET name=!name:~0,8!\!name:~8,4!\!ext:~1! MD "!name!" 2&gt;nul MOVE "%sourcedir%\%%a" "!name!\" &gt;nul ) GOTO :EOF </code></pre> <p>Now I would like to add a WINRAR command to archive just the extension folders created in step 3, I am using this command to create the archives.</p> <pre><code>C:\ ABCEFGHI\0703\PDF&gt;WINRAR A PDF C:\ ABCEFGHI\0703\PDF </code></pre> <p>Is it possible to add this command to the script?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload