Tech Support Forum banner

VBScript

1426 Views 1 Reply 2 Participants Last post by  jamiemac2005
Hi,
I have a ".vbs" file.

The contents of this file are

Set oISM = CreateObject("SAAuto12.ISWiProject")
oISM.OpenProject "C:\Trunk\Installer\VOIP Client.ism"

oISM.ProductVersion = "1.0.0"
'oISM.PackageCode = oISM.GenerateGUID()
'oISM.ProductCode = oISM.GenerateGUID()

oISM.SaveProject
oISM.CloseProject

Set oISM = Nothing

In this the Product Version in this script has to be taken by text file ".txt" the contents of which are are

1.0.0

How do I take it from the text file?

Thanks,
Sahana
Status
Not open for further replies.
1 - 2 of 2 Posts
Hey Sahana,

So it creates a text file with the contents 1.0.0... is that all thats in the text file?

I have limited knowledge of vbscript so excuse me if i go wrong anywhere... I think this is the sort of thing you need to do:

Code:
dim fso, fileToGet, myfileStream, textToRead
set fso = CreateObject ("Scripting.FileSystemObject")
set fileToGet = fso.GetFile("c:\[b]<the file path etc>[/b]")
set myFilestream = fileToGet.OpenAsTextStream (1)
set textToRead = myFileStream.readAll;
myFileStream.Close
textToRead will then hold the entire contents of the txt file, if you only want a bit of it then use the read function(google it)

Cheers,
Jamey
See less See more
1 - 2 of 2 Posts
Status
Not open for further replies.
Top