Jump to content

General Batch File ?


Recommended Posts

Hey guys, I am a complete n00b with batch scripting. I find it understandable for the most part, but some can be a bit confusing.

I'm trying to understand exactly what is going on in this script I found to copy images from a camera drive and save them to the current user's mydocuments/mypic's folder:


It seems fairly understandable, but what is confusing me and I can't understand even after a couple hours of googling is the part specifying the date


FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B

FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B

FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B

SET date=%mm%%dd%%yyyy%

with the FOR command. I slightly understand the TOKENS and DELIMS part, but what is %%A? To my understanding from googling that appears to be a variable, but I do not see it defined anywhere else in this script or understand what it does or %%B

What I get from looking at that portion of the code is the variables should only be mm dd and yyy.

Also anyone know of any video tutorials that provide Windows Shell Scripting/Batch Filing?

Thanks in advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...