本帖最后由 ivor 于 2017-12-21 21:55 编辑
- <# :
- @echo off
- rem 增强代码兼容性,代码保存为 ".bat"、".cmd"、".ps1"均可执行
- powershell Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
- more +8 "%~f0" >"%~dpn0.ps1"
- powershell -File "%~dpn0.ps1"
- del "%~dpn0.ps1" & pause & exit /b
- #>
- $stime = get-date
- $file1 = get-content a.txt
- $file2 = get-content b.txt
- if ($file1.Length > $file2.Length){$end = $file1.Length}else{$end = $file2.Length}
- for($i = 0; $i -le $end; $i++){
- if ($file1){$file1[$i] | out-file -Append -Encoding ascii c.txt}
- if ($file2){$file2[$i] | out-file -Append -Encoding ascii c.txt}
- }
- $stime
- get-date
复制代码
|