0

set v1=%e:\file1\file0%
set v2=%c:\file1\file0%
set v3=%d:\file3\file4%

cd %v1% and do something
cd %v2% and do something
cd %v3% and do something

I just want to set a variable = path and cd to it later, since I have multiple pathes, i would like to cd to diff variables instead of typing over and over the same pathes.

does anyone know the syntax doing stuffs like this?

thanks

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by k2k
0

That wasn't stated very clearly, but I think you were asking how to assign some paths to variables for later use? Try the below example.

set /p path1= "C:\Program Files\Installation\Help-Files"
set /p path2= "C:\Users\Bob-Smith\Documents\My Folder"

cd %path1%
:: Do something

cd %path2%
:: Do something

Cheers!

Edited by VulcanDesign: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.