[英]for loop is not working inside of a windows batch
我想在Windows批處理中執行此操作:
for /F %%A In ('PowerShell Get-Date -UFormat %V') do copy "D:\Versand\Test\OrdersOffers.xlsm" "D:\Versand\Test\OrdersOffersWeek%%A.xlsm"
但是什么也沒發生。 如果我在CMD中這樣做,它將起作用:
for /F %A In ('PowerShell Get-Date -UFormat %V') do copy "D:\Versand\Test\NL_OrdersOffers.xlsm" "D:\Versand\Test\NL_OrdersOffers%A.xlsm"
可能是什么問題呢?
-UFormat %V
變
-UFormat %%V
因為%
是一個特殊字符,必須由%
自身轉義
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.