Page 1 of 1

mv selected file to new location

Posted: 18 Dec 2010 08:47
by dwilbank
Hi.
I thought I knew basic DOS scripting but apparently not.

I'm trying to add a line to an existing script that will move the selected file(s) to a new drive (M:) when the first part of the script is complete.

(I currently right click the desired file(s) and "send" them to the .bat file)

As part of that exercise, I made a sample script consisting of only the following.

Code: Select all

mv %1 M:\


And then I dragged a few test files onto the bat file.
It failed, of course, attempting to recreate (I guess) the entire file path of the selected file inside the M: drive.

Now looking at this line, you will see all sorts of problems.

But after using google for an hour, I can't find a single piece of documentation that describes how to use mv and %1 together.

I surrounded certan parts with quotes, I tried tildes... a little bit of everything!

What am I missing?

Thanks

Re: mv selected file to new location

Posted: 20 Dec 2010 22:12
by DosItHelp
Try "move" instead of "mv" :wink:

move %1 M:\

Re: mv selected file to new location

Posted: 27 Dec 2010 09:04
by dwilbank
Thanks - have been away from my work computer, but will try this when I get back.

Can't wait!