关于利用BAT拷贝文件到系统System32下的问题。

luckyprg 2005-04-27 11:40:41
像下面这样拷贝肯定是可以的
copy a.txt c:\windows\system32\b.txt

但为了兼容Win2000和Win9X(因为Win2000的安装目录是WINNT,Win9X的是Windows),所以想用%windir%来代替系统安装目录。
我改成如下
copy a.txt c:\%windir%\system32\b.txt
可系统不认 %windir% ,请问正确的应该怎样写?
如果可能,最好将安装盘盘符(如C:)也用系统变量代替。谢谢!
...全文
467 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ron_xin 2005-04-27
  • 打赏
  • 举报
回复
C:\>copy a.txt %windir%\system32\b.txt
已复制 1 个文件。
Aceryt 2005-04-27
  • 打赏
  • 举报
回复
%windir%已经包含驱动器盘符了。
oyljerry 2005-04-27
  • 打赏
  • 举报
回复
windir已包含默认的系统盘路径了

6,849

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧