简体   繁体   中英

Windows batch script and privileges for working in HomePath

Funny thing, but I've been working with bash, etc but never with Windows' batch scripting.

What I am trying to do is rename some directory in my HomePath. So I simply do:

cd %HOMEPATH%
ren dirName newDirName

And then I get:

Access denied.

Is it even possible in Windows XP / 7 ?

Thanks !

Are you sure that you're already on the correct drive? %HOMEPATH% only gives you the directory, not the drive.

I'd suggest trying:

%HOMEDRIVE%
cd %HOMEPATH%
ren dirName newDirName

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM