Computing.Net > Forums > Disk Operating System > Need help with Bat File

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.

Need help with Bat File

Reply to Message Icon

Name: JGreat277
Date: April 8, 2003 at 13:28:40 Pacific
OS: Win2k
CPU/Ram: 1.3Ghz/1GB
Comment:

I'm horrible when it comes to writing bat files, and was hoping someone out there might be able to help.

I'm looking for a bat file that will work as follows.

The file format: ????###.asc
ex: ????324.asc

Looking to have the bat file run, and then prompt the user for a date, ie. 324.

Once the user inputs the date, the bat file looks for the files ????324.asc and copies them to another directory.

Can anyone help? Thanks in advance!



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: April 9, 2003 at 02:23:54 Pacific
Reply:

If I understand, the following script is what you need:

@Echo Off
If %1.==(). GoTo EXEC
Echo Parametric Copy
Echo.
Cmd /V:On /C Call %0 ()
Echo.
Echo Copy Ended
GoTo EXIT

:EXEC
Set /P PCFrom=Enter Directory From:
Set /P PCTo=Enter Directory To:
Set /P PCPar=Enter ###:

If not exist !PCFrom!\Nul GoTo ERR
If not exist !PCTo!\Nul GoTo ERR

Copy !PCFrom!\????!PCPar!.asc !PCTo!
GoTo EXIT

:ERR
Echo Error in From/To Directories
GoTo EXIT

:EXIT

The only limitation is blank characters embedded in pathnames.
I hope this helps


0

Response Number 2
Name: JGreat277
Date: April 9, 2003 at 06:34:16 Pacific
Reply:

Thank you Ivo.

I'm working with it now. Getting some errors at the end with it not finding the files. Not sure if it's a path problem or not, but I'll at it.

Thanks again!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Need help with Bat File

Need help with .bat file! www.computing.net/answers/dos/need-help-with-bat-file/14811.html

Help with Bat file www.computing.net/answers/dos/help-with-bat-file/13551.html

Need help with a Dos batch file www.computing.net/answers/dos/need-help-with-a-dos-batch-file/13006.html