Batch file help

K

Kamek

Ok I'll start off with some background stuff. We have a raid array
we use to store video files, and a 2tb NAS we want to use as nearline
storage for those files. Our video files or broken up like this
U:\program.dir\video.mov but along with that mov we have to go into the
media.dir directory and grab a video.wav and video.m2v of the same name
and then copy those files over to the nas using windows file sharing.
What we want to do is automate this process and hopefully integrate
it into windows explorer so we can do this just by clicking or right
clicking on the target file.
I've tryed doing this and it kind of works heres my bat file:
cd program.dir
copy %* u:\
cd media.dir
copy %*.wav u:\media.dir
copy %*.m2v u:\media.dir

Now this works from the command line if you dont give the argument
with a filename but I'm assuming if I want to associate .mov's with
this batch and have it run when I double click or something windows
will give it a file extension. How would I chop the file extension off
of %1?
I tryed file=%1, file=%file:~-4,4% but that makes file = to .mov.
Any ideas?
 
P

Pegasus \(MVP\)

Try this:

@echo off
xcopy "U:\Program.Dir" "U:\"

The rest of your batch file makes no sense - you're
trying to copy files from "media.dir" back to "media.dir",
which is the same folder! Use the syntax in the line above
to specify the desired source and target folder.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top