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%
精彩评论