如何使用以下变量
SET DESKTOP_PATH = C:\Users\Kostas\Desktop\ToMobile
SET MOBILE_PATH = H:\koinoxrista
xcopy命令中的?
我使用以下代码
xcopy %DESKTOP_PATH%\*.txt %MOBILE_PATH% /v
但我收到了
file not found - *.txt
这是我的代码
@echo off
SET DESKTOP_PATH = C:\Users\Kostas\Desktop\ToMobile
SET MOBILE_PATH = H:\koinoxrista
chdir \
chdir /d h:\koinoxrista
SET "FLAG="
IF EXIST Bill.txt SET FLAG=1
IF EXIST BillPayments.txt SET FLAG=1
IF EXIST Collector.txt SET FLAG=1
IF EXIST CompanyInfo.txt SET FLAG=1
IF EXIST Expense.txt SET FLAG=1
IF EXIST ExpensePayments.txt SET FLAG=1
IF EXIST FlatComments.txt SET FLAG=1
IF EXIST FlatMetric.txt SET FLAG=1
IF DEFINED FLAG (ECHO Error!) ELSE (xcopy %DESKTOP_PATH%\*.txt %MOBILE_PATH% /v /w)
pause
答案 0 :(得分:3)
删除SET命令中的空格
SET DESKTOP_PATH=C:\Users\Kostas\Desktop\ToMobile
SET MOBILE_PATH=H:\koinoxrista