Move It Central というソフトウェアを使用しています。さまざまなファイルに対して使用する VBScript のアップロードが可能になります。行MICacheFilename()
は戻りますC:\TEMP\path\file.tmp
が、このファイルは単純な txt ファイルです。
メソッドを使用してこのテキスト ファイルの行数を数えようとしていますOpenTextFile
が、エラーが発生しますObject doesn't support this property or method
。なぜこれを取得しているのか理解できないようです。スクリプトは以下です。私は VBS に非常に慣れていないため、問題の多くはユーザー エラーであると考えています。
Sub main()
Dim objFSO, textInput, strTextFile, actualRows, testRows, mFunction, strTemp
CONST ForReading = 1
MISetTaskParam "cachedFile", mFile
textInput = "the next line is the cachedFile"
MILogMsg textInput
MILogMsg mFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
strTextFile = MICacheFilename()
textInput = objFSO.OpenTextFile(strTextFile,ForReading)
testRows = MIGetTaskParam("testRows")
Do While textInput.AtEndOfStream <> True
strTemp = textInput.SkipLine
Loop
IF textInput.Line-1 >= testRows THEN
MILogMsg "true"
ELSE
MILogMsg "false"
END IF
end sub
main