• 0

Wanting to write a batch file


Question

Hey guys, firstly, sorry if this is in the wrong section but i couldn't think where else to post this topic, also i didn't post the [PROGRAMMING LANGUAGE] tag on the beginning of my title but i wasn't sure what it should be.

Basically, i'm wanting to make a batch file to do the following as my dad always seems to struggle remembering how to transfer his digital pictures to his computer:

  • Select all the pictures in the digital cameras folder i.e. E:\DCIM\
  • Move them to a specific folder on the computer i.e. C:\Users\Dad\Desktop\Digital Photos
  • Launch a prompt to tell the user it's finished transferring the pictures (unless the moving files will cause a file transfer window to pop up)

Also, would it be hard to make the Batch file auto locate the digital camera location of the pictures in case it didn't connect as E:\?

Any help will be greatly appreciated :)

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

@echo off

echo Moving pictures from camera to computer

move /y e:\DCIM\*.jpg C:\Users\Dad\Desktop\Digital Photos\

echo Download of pictures completed

Pause

Link to comment
Share on other sites

  • 0

@echo off

set src=DCIM\*.jpg

set dest="%userprofile%\Desktop\Digital Photos\"

if not exist %dest% md %dest%

echo Moving pictures from camera to computer

if exist e:\%src% move /y e:\%src% %dest%

if exist f:\%src% move /y f:\%src% %dest%

...

if exist z:\%src% move /y z:\%src% %dest%

echo Download of pictures completed

Pause

Link to comment
Share on other sites

  • 0
@echo off

set src=DCIM\*.jpg

Searching (src?) for the DCIM folder? (on any drive letter?, if so how would one exclude C: from the search?)

set dest="%userprofile%\Desktop\Digital Photos\"

Setting destination folder, the %username% presumably is so it will work regardless of the username and desktop\digital photos\ will be the file in the user folder, does %username% work in Xp, vista and 7 alike?

if not exist %dest% md %dest%

Creates a destination folder called 'Digital Photos' if it doesn't already exist?

echo Moving pictures from camera to computer

if exist e:\%src% move /y e:\%src% %dest%

Not sure what this and the subsequent lines do

if exist f:\%src% move /y f:\%src% %dest%

...

if exist z:\%src% move /y z:\%src% %dest%

echo Download of pictures completed

Pause

If it's not too much trouble would you mind going over what each step does so i can customize it? Basically tell me if my assumptions were correct and correct any errors on my part lol

Link to comment
Share on other sites

  • 0
If it's not too much trouble would you mind going over what each step does so i can customize it? Basically tell me if my assumptions were correct and correct any errors on my part lol

src = "source" not "searching"... he's setting the source directory where the pictures are coming from

you've got 'dest' right. I'm not personally sure about compatibility with XP through Windows 7.

the lines after: if exist e:\ ....

basically they check each drive letter (F: though Z:) in case the camera "installed" to a different drive like you had asked about in your original post. That way, if it installs somewhere else, the script with still copy the images.

Link to comment
Share on other sites

  • 0
i would perhaps show the progress of the transfer too

How would one go about this and hide the cmd prompt showing the batch running?

Also, does anyone have any good links where i could learn more about 'Batch Programming' myself? :)

Link to comment
Share on other sites

  • 0
How would one go about this and hide the cmd prompt showing the batch running?

umm... with difficulty.. you would have have to show the black window.

in fact, i think it would be beneficial showing the black window that way the user at least knows something is going on

Also, does anyone have any good links where i could learn more about 'Batch Programming' myself? :)

I would potentially look at powershell instead.. http://en.wikipedia.org/wiki/Windows_PowerShell

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.