0
假設我有這樣的:如何打開絕對路徑中的var內容?
set X = ..
如何打開,後來變成了絕對路徑?你能否寫下它將如何在腳本中?
我試圖與%~dpX
,但給了此錯誤消息: The following usage of the path operator in batch-parameter substitution is invalid: %~dpX
假設我有這樣的:如何打開絕對路徑中的var內容?
set X = ..
如何打開,後來變成了絕對路徑?你能否寫下它將如何在腳本中?
我試圖與%~dpX
,但給了此錯誤消息: The following usage of the path operator in batch-parameter substitution is invalid: %~dpX
很多搜索之後,我想通了,這樣做的方式:約
for %%y in (%X%) do set X=%%~dpy
請,從來沒有把空間批處理中'set'語句中的'='。 – Joey 2009-10-20 16:45:46
你能否給出一個原因爲什麼不呢? – Geo 2009-10-20 17:04:33
因爲空格成爲變量名稱的一部分 – 2009-10-21 10:47:48