开发者

Setting environmental variable in batch as a path (not working for me) on Windows

开发者 https://www.devze.com 2023-04-11 06:38 出处:网络
I want to set my folder C:\\Users\\开发者_Go百科scruff\\Desktop\\MinGW2\\Cross as variable PREFIX

I want to set my folder C:\Users\开发者_Go百科scruff\Desktop\MinGW2\Cross as variable PREFIX

So I type:

set PREFIX=C:\Users\scruff\Desktop\MinGW2\Cross

But then when I do:

cd PREFIX 

I get

"The system cannot find the specified path". 

When I do

echo %PREFIX%

I get:

C:\Users\scruff\Desktop\MinGW2\Cross 

when is do:

cd C:\Users\scruff\Desktop\MinGW2\Cross

it takes me to the cross directory fine.

:(


Try cd %prefix%.

DOS/Windows batch files aren't really very clever, you might want to investigate Powershell as an alternative: http://technet.microsoft.com/en-us/scriptcenter/dd742419

0

精彩评论

暂无评论...
验证码 换一张
取 消