mv selected file to new location

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dwilbank
Posts: 6
Joined: 10 Nov 2010 11:18

mv selected file to new location

#1 Post by dwilbank » 18 Dec 2010 08:47

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

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

Re: mv selected file to new location

#2 Post by DosItHelp » 20 Dec 2010 22:12

Try "move" instead of "mv" :wink:

move %1 M:\

dwilbank
Posts: 6
Joined: 10 Nov 2010 11:18

Re: mv selected file to new location

#3 Post by dwilbank » 27 Dec 2010 09:04

Thanks - have been away from my work computer, but will try this when I get back.

Can't wait!

Post Reply