开发者

How to Change to current user's directory in a batch file

How is it possible to c开发者_StackOverflow中文版hange to a user default directory

Is there a default variable that can be used e.g. %USER%

would return: C:\Users\MyUsername


Use %UserProfile%.

cd /D %UserProfile%

/D : change the current DRIVE in addition to changing folder.


Use %HOMEPATH%.

So:

CD %HOMEPATH%
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜