跳到主要內容

發表文章

目前顯示的是有「command」標籤的文章

How to remove a substring via batch command

Here is a tip to remove a substring via batch command For example: If I'd like to remove file extension name  from  Install .wim to  Install We can try below command: Test.cmd SET WINPE=%1 echo %WINPE% SET WINPE=%WINPE:.wim=% echo %WINPE% Input:  Test.cmd Install.wim Output:  Install REF: http://www.dostips.com/DtTipsStringManipulation.php

[Batch][loop] Recurse find specified file and do something

Assume you need to update many  Setting.xml  in the specified directory and they locate on different sub-folders. You can copy&past one-by-one if you have a lot of time to do this. Or you can try below batch script:  SET FileName ="C:\Users\Andy\Dropbox\ Setting.xml " FOR /F  "usebackq delims==" %%i IN (`dir /b /s Setting.xml `) DO COPY /Y  %FileName% "%%i"