我正在努力减少为员工在工作中设置Autodesk所需的时间。为此,我需要首先映射网络驱动器,然后将几个文件从网络驱动器复制到用户C驱动器上的Autodesk。但是,由于每个PC都会进入用户配置文件,因此它们会有所不同;我必须创建一个输入变量来接受名称。
这就是我所拥有的:
@echo Create new K: drive mapping
@net use K: \\vasalacad\autocad\library
@echo Enter User ID "firstname.lastname"
@set /p UserID=""
@copy /y "K:\setups\tmco1.dwt" "C:\Users\"UserID"\AppData\Local\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Template"
@copy /y "K:\setups\BlackPlot.ctb" "C:\Users\"UserID"\AppData\Roaming\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Plotters\Plot Styles"
:exit
@pause
我得到的是:
Create new K: drive mapping The command completed successfully. Enter User ID "firstname.lastname" ******.******* The system cannot find the path specified. 0 file(s) copied. The system cannot find the path specified. 0 file(s) copied. Press any key to continue . . .
我编辑了用户输入,因此我不会在论坛上显示该名称。任何帮助将非常感激。提前谢谢。
答案 0 :(得分:1)
使用@copy /y "K:\setups\tmco1.dwt" "C:\Users\%UserID%\AppData\Local\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Template"
@copy /y "K:\setups\BlackPlot.ctb" "C:\Users\%UserID%\AppData\Roaming\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Plotters\Plot Styles"
正确使用您的env变量:
@copy /y "\\vasalacad\autocad\library\setups\tmco1.dwt" "%USERPROFILE%\AppData\Local\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Template"
@copy /y "\\vasalacad\autocad\library\setups\BlackPlot.ctb" "%USERPROFILE%\AppData\Roaming\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Plotters\Plot Styles"
或者,您可以向用户提供脚本,在这种情况下,没有交互,他们会这样做(不需要安装驱动器BTW):
users.txt
OR:创建一个文本文件(此处为@echo off
set SRC=\\vasalacad\autocad\library\setups
for /F %%a in (users.txt) do (copy /y "%SRC%\tmco1.dwt" "C:\Users\%%a\AppData\Local\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Template"
copy /y "%SRC%\BlackPlot.ctb" "C:\Users\%%a\AppData\Roaming\Autodesk\AutoCAD Electrical 2015\R20.0\enu\Plotters\Plot Styles"
)
),每行包含1个用户,并在循环中复制文件:
import numpy as np
A = np.asarray([1,3,5,7,9])
B = np.asarray([2,4,6,8,10])