Reading fdeploy.ini from GPO with VBS

itnifl
itnifl used Ask the Experts™
on
I am only displaying the relevant part of the code, the part that reads the file.

I am trying to read \\domaincontroller\sysvol\domain.suffix.com\Policies\{0A6D9D8D-606C-4AFB-80B0-7B8A2B441825}\User\Documents & Settings\fdeploy.ini to get the GPO redirected start menu path. I am trying this in VBS.

Seems like that I am getting only blank lines, even though my user account has full access.

What am I doing wrong?
Set oSettingsFile = oFSO.OpenTextFile(strFilePath,ForReading)
			Wscript.Echo "Opening file: " & strFilePath
			Do Until oSettingsFile.AtEndOfStream  
				strLine = oSettingsFile.ReadLine 
				Wscript.Echo strLine
				If sendNextLine = True Then
					pathsfound = pathsfound & strline & " | "
					wscript.echo "What we have f ound thus far is: " & pathsfound
					sendNextline = False 
				End If
				If InStr(Trim(strLine),"[Start Menu]") Then
					sendNextLine = True
				End If
			Loop

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014
Commented:
Hi, try reading the file in UniCode format by changing
intUniCode = -1
Set oSettingsFile = oFSO.OpenTextFile(strFilePath,ForReading)

Open in new window


to this
intUniCode = -1
Set oSettingsFile = oFSO.OpenTextFile(strFilePath,ForReading,False,intUniCode)

Open in new window


Regards,

Rob.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial