Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:00:52+00:00 2026-06-17T03:00:52+00:00

Current code: @echo off setlocal EnableExtensions EnableDelayedExpansion :: Create Empty Folder rd /Q %Temp%\Temp

  • 0

Current code:

@echo off
setlocal EnableExtensions EnableDelayedExpansion

:: Create Empty Folder
rd /Q "%Temp%\Temp" 2>nul & mkdir "%Temp%\Temp"

:: Loop through Folders
pushd "xPath=c:\processing"
for /d %%D in (*) do call :Process "%%~fD"
popd
goto End


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:Process <Parent>
:: Folder Name
set "xFolder=%~nx1"

:: Set Sub Folder
if not exist "%~1\VIDEO\" goto :eof
pushd "%~1\VIDEO"

:: Loop through Videos
for /f "delims=" %%A in ('dir *.avi /b') do if exist "%%~fA" (
    set "xDateWritten=%%~tA"
    set "xDateGMT=0000/00/00 00:00:00"
    for /f "tokens=1,2" %%X in ('robocopy . "%Temp%\Temp" "%%~nxA" /TS /FP /NS /NC /NP /NJH /NJS /NDL /L') do set "xDateGMT=%%X %%Y"
    rem Format = FF-FF-YYYYMMDD-HHhMMmSSs-FF-FF.ext
set "xFrame=00,00000"
for /f %%X in ('exiftool -p "$Framerate,$Framecount" "%%~fA"') do set "xFrame=%%~X"
set "xSize=%%~zA"
set "xName=%xFolder:~0,2%-%xFolder:~2,2%-!xDateWritten:~6,4!!xDateWritten:~0,2!!xDateWritten:~3,2!-!xDateWritten:~11,2!h-!xDateWritten:~14,2!m-!xDateGMT:~17,2!s-%xFolder:~4,2%-%xFolder:~6,2%%%~xA"
echo !xName!
ren "%%~fA" "!xName!"
echo !xName!,!xSize!,!xFrame!>>C:\processing\RenameOutput.csv
)
popd
goto :eof


:End
endlocal
pause

I previously believed my folder structure would be ex:

C:\processing\15010107\Video\files.avi

, but it’s actually

C:\processing\15010107\Video\filedate\files.avi

, so I need it to search 1 more subfolder down than it was before.

Also, the renamed files need to have 24hr format for the time, it’s currently outputting the pm time but without a pm flag, which can get mixed up with the am files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:00:53+00:00Added an answer on June 17, 2026 at 3:00 am

    I believe that these changes should cover your new issues.

    1. Changed the Folder Loop to also Loop through the sub filedate folders.
    2. The Process function now takes two parameters the parent folder and current folder.
    3. The Hour is now adjusted to 24 hour format.

    Full Script (Added Comments)

    @echo off
    setlocal EnableExtensions EnableDelayedExpansion
    
    :: Create Empty Folder
    rd /Q "%Temp%\Temp" 2>nul & mkdir "%Temp%\Temp"
    
    :: Loop through Folders
    pushd "xPath=c:\processing"
    for /d %%D in (*) do if exist "%%~fD\VIDEO\" (
        pushd "%%~fD\VIDEO\"
        for /d %%S in (*) do call :Process "%%~fD" "%%~fS"
        popd
    )
    popd
    goto End
    
    
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :Process <Parent> <Working>
    :: Folder Name
    set "xFolder=%~nx1"
    
    :: Set Working Directory
    if not exist "%~f2" goto :eof
    pushd "%~f2"
    
    :: Loop through Videos
    for /f "delims=" %%A in ('dir *.avi /b') do if exist "%%~fA" (
        rem Retrieve the file time stamp
        set "xDateWritten=%%~tA"
        rem Retrieve the Seconds using RoboCopy
        set "xDateGMT=0000/00/00 00:00:00"
        for /f "tokens=1,2" %%X in ('robocopy . "%Temp%\Temp" "%%~nxA" /TS /FP /NS /NC /NP /NJH /NJS /NDL /L') do set "xDateGMT=%%X %%Y"
        rem Retrieve the Video frame information
        set "xFrame=00,00000"
        for /f %%X in ('exiftool -p "$Framerate,$Framecount" "%%~fA"') do set "xFrame=%%~X"
        rem Retrieve the file size
        set "xSize=%%~zA"
        rem Adjust to 24 hours
        set "xHour=!xDateWritten:~11,2!"
        if "!xDateWritten:~17,2!"=="PM" set /a "xHour+=12"
        rem Format = FF-FF-YYYYMMDD-HHh-MMm-SSs-FF-FF.ext
        set "xName=%xFolder:~0,2%-%xFolder:~2,2%-!xDateWritten:~6,4!!xDateWritten:~0,2!!xDateWritten:~3,2!-!xHour!h-!xDateWritten:~14,2!m-!xDateGMT:~17,2!s-%xFolder:~4,2%-%xFolder:~6,2%%%~xA"
        rem Display, Rename, and Save
        echo !xName!
        ren "%%~fA" "!xName!"
        echo !xName!,!xSize!,!xFrame!>>C:\processing\RenameOutput.csv
    )
    popd
    goto :eof
    
    
    :End
    endlocal
    pause
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current code is below. <?php header('Content-Type: image/png'); header('Content-Disposition: attachment; filename=Skin'); echo file_get_contents(http://domain.tld/script/skins/' .
what my current Code do : i have this HTML <li> <span>Logged in as</span>&nbsp;
This is what my current code this look: <?php echo $user_join_date; ?> This is
This is my current code that doesn't seem to work correctly. echo date(h:i, 1*60*60)
my current code: <?php $timestamp = DateTime::createFromFormat(d.m.Y H:i, $_POST[datetime]); echo $timestamp; // works! ?>
current code (not working): /^script\s*type=\text\/javascript/i.test(tagName)
current code I've built function to do something over collection of jQuery elements: var
My current code uploads image successfully but still it does not show Toast message
My current code is this $swift = email::connect(); $swift->setSubject('hello') ->setFrom(array('alex@example.com.au' => 'Alex')) ->setTo(array('alex@example.com.au' =>
My current code needs to read foreign characters from the web, currently my solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.