Hello,
I have an error message when I test my install program. It append text to a file OK but create an error message. I have include this Custom Action : I am willing to upgrade my software and Maintenance plan to get support :
The use of this install program is to append many thousands line of text to an AutoCAD .pat file. Can you help step by step.
' EditPreferences.vbs
' Sample VBScript to write to a file.
' Author Guy Thomas http://computerperformance.co.uk/
' Ezine 79 Version 2.4 - July 2005
' -------------------------------------------------------------'
Option Explicit
Dim objFSO, objFolder, objShell, objTextFile, objFile
Dim strDirectory, strFile, strText
strDirectory = "c:\Ezine"
strFile = "\GuySays.txt"
strText = "Edit your Ezine Preferences"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Check that the strDirectory folder exists
If objFSO.FolderExists(strDirectory) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFolder = objFSO.CreateFolder(strDirectory)
WScript.Echo "Just created " & strDirectory
End If
If objFSO.FileExists(strDirectory & strFile) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Else
Set objFile = objFSO.CreateTextFile(strDirectory & strFile)
Wscript.Echo "Just created " & strDirectory & strFile
End If
set objFile = nothing
set objFolder = Nothing
' OpenTextFile Method needs a Const value
' ForAppending = 8 ForReading = 1, ForWriting = 2
Const ForAppending = 8
Set objTextFile = objFSO.OpenTextFile _
(strDirectory & strFile, ForAppending, True)
' Key Section to write the strText to the file.
' Writes strText every time you run this VBScript
objTextFile.WriteLine(strText)
objTextFile.Close
' Guy's idea for testing your script.
If err.number = vbEmpty then
Set objShell = CreateObject("WScript.Shell")
objShell.run ("Explorer" &" " & strDirectory & "\" )
Else WScript.echo "VBScript Error: " & err.number
End If
WScript.Quit
' End of VBScript to write to a file