1.

Solve : How to capture file path in a variable?

Answer»

Hi guys,
I have a doubt that , can we capture path of the file in a variable and use it for other purpose.

eg:
suppose i have a text file named test.txt in this location c:\newfolder1\newfolder2\newfolder3\text.txt. And iam USING this path many times in my batch file and i donot want to COPY and paste this path EVERY time. can i set c:\newfolder1\newfolder2\newfolder3 in a variable and use it. I couldn't figure it out. Will u guys help me...

THANKS in advance.

regards,
chinnaset /?
Hi guys,
Will you plz provide the syntax for this....

Thank you,

regards
chinnaTo set the variable for use,

Quote

set variablename=value

To use it in code,

Quote
echo %variablename%
hi guys,
i need to set the filepath as variable but not value. plz help me..

thanks

regards,
chinnaWhat do you mean you want to set it as a variable but not a value?

A variable in a batch program has a value, whether it be numeric or a string of CHARACTERS it is a value.


Discussion

No Comment Found