简体   繁体   English

Windows批处理脚本和在HomePath中工作的特权

[英]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. 有趣的是,但我一直在使用bash等,但从未使用Windows的批处理脚本。

What I am trying to do is rename some directory in my HomePath. 我想做的是在HomePath中重命名某些目录。 So I simply do: 所以我只是做:

cd %HOMEPATH%
ren dirName newDirName

And then I get: 然后我得到:

Access denied.

Is it even possible in Windows XP / 7 ? 在Windows XP / 7中甚至可能吗?

Thanks ! 谢谢 !

Are you sure that you're already on the correct drive? 您确定您已经在正确的驱动器上了吗? %HOMEPATH% only gives you the directory, not the drive. %HOMEPATH%仅给您目录,而不给驱动器。

I'd suggest trying: 我建议尝试:

%HOMEDRIVE%
cd %HOMEPATH%
ren dirName newDirName

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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