本帖最后由 CrLf 于 2017-1-7 15:42 编辑
- 1>1/* :
- @echo off
-
- set "from=Z:\源文件夹"
- set "to=Z:\备份文件夹"
-
- for /f "delims=" %%a in ('dir /s /a /b "%to%\*" ^| sort /+65535 ^| cscript -nologo -e:jscript "%~f0" "%to%"') do (
- for %%b in ("%to%\%%a") do (
- if %%~aza neq %%~azb (
- rd /s /q "%to%%%a" || del /f "%to%%%a"
- )
- )
- )
-
- xcopy /d /e /y /r /k /x /h /c "%from%" "%to%"
-
- pause & exit /b
-
- */
-
- var length=WSH.Arguments(0).length
- var output=
- WSH.StdIn.ReadAll().replace(
- new RegExp( '^.{'+length+'}', 'gm' ),
- ''
- )
-
- WSH.Echo(output)
复制代码
|