我有一些問題:腳本優化
如何爲報價支持;設置數據「(」C:\ text.txt「,True)」。
請修改以下優化程序代碼並加快速度。
如何保持或暫停,直到txt文件在繼續或讀取此文件之前創建。
set A_mark {"}
set B_mark {(}
set C_mark {)}
set D_mark {,}
set path [pwd]
set pathFile [file join $path text.txt]
set strgdt [join [list "Set objFile = objFSO.CreateTextFile" "$B_mark$A_mark$pathFile$A_mark$D_mark True$C_mark"] ""]
#HERE THE FIRST QUESTIONS
#I would like to write the format string example like this: Set objFile = objFSO.CreateTextFile("C:\text.txt", True)
set vbs [list \
{On Error Resume Next} \
{Const wbemFlagReturnImmediately = &h10} \
{Const wbemFlagForwardOnly = &h20} \
{Dim objFSO, objFile} \
{Set objFSO = CreateObject("Scripting.FileSystemObject")} \
"$strgdt" \ ;#The variable from above
#so on..
]
#Write the vbsFile
set oFile [open "vscr.vbs" w]
#Run the vbs file then create a txt file
set res [exec {cmd.exe /c [file join $path vbscrpting.vbs]}]
#HERE THE SECOND QUESTIONS
#How to make sure the file already created and if the txt file still on processing then wait until finish create it.
#Open txt file
set txtFile [open "text.txt" r]