Computing.Net > Forums > Windows XP > DOS bat file to MOVE files w prompt

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS bat file to MOVE files w prompt

Reply to Message Icon

Name: taevans
Date: February 8, 2008 at 18:17:08 Pacific
OS: XP sp2
CPU/Ram: 1.1ghz 512mb
Product: HP
Comment:

Hello, Hope you can help me. I learned basic DOS 15 years ago and haven't used it at all in the last 10 years. I need a batch file to MOVE a single file from one location to another, but also prompts the user to enter a "claim" number, which is actually file name with a .xls at the end.

Can the batch file append the .xls to the end of the file name they key in?

Example: If the Claim# they key in, when prompted, is 123456789 then the command would look like
move H:\Benefit\Example\123456789.xls H:\Benefit\Example\60 Day Hold\

I would also like to have the batch file validate the success of the move. Example, if the move was successful then echo a message like, "Move Complete". If the claim number was NOT found then take them back to the prompt that asks them to enter the claim number.

If you can provide any help at all my team and I would certainly appreciate it. Thanks so much for your tim


Angel



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: February 8, 2008 at 18:59:06 Pacific
Reply:

I learned basic DOS 15 years ago and haven't used it at all in the last 10 years.
Well then you're in luck! DOS died 13 years ago, so you'll never need to get better at it!

If you want a Command Script, though, then I can help you.

@ECHO OFF
SET /P claim=Claim #:
MOVE "H:\Benefit\Example\%claim%.xls" "H:\Benefit\Example\60 Day Hold\" >NUL 2>&1 &&ECHO Move Complete ||"%~F0"

Yes, that third line is really that long. No, I'm not throwing off the formatting for the sheer thrill of it.


0

Response Number 2
Name: taevans
Date: February 8, 2008 at 20:08:43 Pacific
Reply:

I can't wait to get back to the office and kick this off. You have no idea how much I appreciate this! Thank you so very very much.

You're awesome... Have a GREAT weekend!

Angel

PS Sure is a good thing I didn't have to get out the old books and try to figure it out... It would have never happened. lol


0

Response Number 3
Name: WebsWonder
Date: February 8, 2008 at 22:27:19 Pacific
Reply:

FYI: XP has NT Command Prompt this is not the same as MS-DOS you used thirteen years ago....


0

Response Number 4
Name: wanderer
Date: February 9, 2008 at 09:34:11 Pacific
Reply:

"Can the batch file append the .xls to the end of the file name they key in?"

Additonally you can't just tack a xls extension on a file and expect Excel to open it. FYI

Are you ready for where Microsoft wants you to go today?


0

Response Number 5
Name: taevans
Date: February 9, 2008 at 09:52:10 Pacific
Reply:

Dear Razor2.3, The command script worked like a dream! My Claims Processors are moving files like crazy and I have some piece of mind since they are not using the ole Windows drag and drop. I knew if they used drag and drop they would be grabbing the wrong files or moving them to places they didn't belong. Nothing is fool proof but this sure adds a level of protection I feel better about. Thank you so much again.

Everyone, thanks for taking the time to share your comments and suggestions. I do appreciate you all!!!

Angel


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: DOS bat file to MOVE files w prompt

Dos .bat on xp need help www.computing.net/answers/windows-xp/dos-bat-on-xp-need-help/80418.html

Read first n lines with MS-DOS bat file www.computing.net/answers/windows-xp/read-first-n-lines-with-msdos-bat-file-/179221.html

Make .bat file to launch dos app www.computing.net/answers/windows-xp/make-bat-file-to-launch-dos-app/61748.html