Computing.Net > Forums > Disk Operating System > giving a path to a batch 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.

giving a path to a batch file

Reply to Message Icon

Name: mfc_oracle
Date: April 21, 2004 at 02:16:52 Pacific
OS: DOS 6.2 or higher
CPU/Ram: X86 family (Pentium II) 3
Comment:

I'd like to give a path to a batch file to copy some files in that path.
Could you please let me know how can I do that? I've used the following but didn't work!
copy c:\myfile.txt %1\myfile.txt



Sponsored Link
Ads by Google

Response Number 1
Name: uli_glueck
Date: April 21, 2004 at 04:53:15 Pacific
Reply:


Hi Sheila

What is exactly in your variable?
Do you just want to copy from one folder to another folder on the same drive?
Give us a bit more information. Then it is easier to help.

uli


0

Response Number 2
Name: melee5
Date: April 21, 2004 at 22:07:06 Pacific
Reply:

Hoping that the basics are what you after here Shelia, you invoke the batch file with a command line entry and pass the path to it at the same time like:

yourbatch yourpath

%0=yourbatch %1=yourpath %2=""
Then inside your batch file, this would work to copy c:\myfile.txt to yourpath\myfile.txt:
copy c:\myfile.txt %1\myfile.txt

yourpath must start with drive letter and NOT end with backslash as you already have the backslash included in your example. Since you didn't change the name of the copied file during the copy process, this would also work with the same rules above:
copy c:\myfile.txt %1

If this didn't get you going then give a few more details. I'm not even sure I'm answering your question here.


0

Response Number 3
Name: dAn
Date: May 12, 2004 at 08:03:42 Pacific
Reply:

Sheila,

If you start your batchfile with:

PATH=MYPATH;%PATH%

MYPATH will be added before the path which was already set.

Please let me know if this answers your question.

dAn


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: giving a path to a batch file

open app with a batch file?? www.computing.net/answers/dos/open-app-with-a-batch-file/10502.html

Dos Commands in a batch file www.computing.net/answers/dos/dos-commands-in-a-batch-file/1258.html

Close a batch file www.computing.net/answers/dos/close-a-batch-file/2179.html