Link to home
Start Free TrialLog in
Avatar of KPS2007
KPS2007

asked on

Pass variable file path to batch file?

I need some help passing a variable to a batch file, specifically the path of a file.  My batch file looks something like this:
net use lpt2:  serverdesignjet
copy /b filename.plt lpt2
net use lpt2: /delete

It would be great if users could just drag a .plt on to this batch file and have it run.  Currently the have to move the .plt file and rename it, which as you can imagine isn't very fast.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SteveGTR: are  you loving' this new 'code-snippett' feature or what? ;0)
Yes I am.

Although it does appear that some users attempt to paste the line numbers with the code. You can do it by starting the drag at the numbers. One user insisted it was a bug and asked if I would repost the code in a message.
Avatar of KPS2007
KPS2007

ASKER

This snippet helped me get it running the way I like, thanks!
ROFL, that cracks me up ... and so you can!  Perhaps EE could consider rendering them in a way that they can't become part of copy/paste op (or even provide a download this as a "TEXT" file button).
That's a good idea. Because if one user can do it you know that more users can.