我花了几个小时在文档和论坛上试图解决这个问题。
代码运行没有错误,但批处理脚本没有被执行。
我省略了读者这#include<*>
部分,因为它非常冗长。
oToClip()
Func oToClip()
Local $sleep = 250
Sleep($sleep)
Local $sFilePath = "%userprofile%\oToClip.bat"
Sleep($sleep)
Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND + $FO_CREATEPATH)
If $hFileOpen = -1 Then
MsgBox($MB_SYSTEMMODAL, "", "An error occurred when opening the file.")
EndIf
Sleep($sleep)
FileWriteLine($hFileOpen, "type %userprofile%\o.txt | clip")
Sleep($sleep)
FileClose($hFileOpen)
Sleep($sleep)
RunWait(@ComSpec & " /c " & $sFilePath)
EndFunc ;==>oToClip