【发布时间】:2023-03-07 23:10:01
【问题描述】:
我正在尝试创建一个简单的文件合并工具来将拆分日志文件合并到一个文本文件中。
FileSelectFolder, folder, \\Myserver\Data\
InputBox, filename, Save File,Please type the name you will call the merged file.`n The file will be saved in the folder "merged" of the same root directory as its "part files" are located., , , , , , , ,merged_file.txt
if errorlevel = 1
exitApp
IfExist, %folder%\merged\%filename%
MsgBox, 4, File Overwrite -or- Append?, The file already exists. Do you want to append to this file? `nNote: If you select "No" the existing file will be replaced during this process.
ifmsgbox, no
FileDelete %folder%\merged\%filename%
FileCreateDir, %folder%\merged
IfExist %folder%\merged\%filename%_file_list.txt
FileDelete %folder%\merged\%filename%_file_list.txt
Runwait, %COMSPEC% /c copy /k %folder%\*.log %folder%\merged\%filename%
ExitApp
我不想使用 AHK fileread 和 fileappend,因为日志文件相当大 ~40mb。
上面的代码不会产生任何错误,但也不会产生任何文件。 我尝试将 " 添加到参数中,但没有成功。
【问题讨论】:
标签: windows file cmd autohotkey