在批处理中,我知道您始终可以在批处理/ cmd中指定文件夹路径,例如
echo %RANDOM% >> C:\Users\User\Logs\log.txt
或
start C:\Windows\System32\cmd.exe
但是,例如,您的批处理文件是否用于产品中,这些位置可能不同或不存在?你会如何指定?
答案 0 :(得分:0)
if exist filename.ext (
rem file exists
) else (
rem file doesn't exist
)
另请参阅this question。
如果无法使用相对路径,请使用环境变量;因为你的客户站的每件事都可能不同。