Avatar of itnifl
itnifl
Flag for Norway

asked on 

Reading fdeploy.ini from GPO with VBS

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

VB ScriptWindows Server 2008Windows Server 2003

Avatar of undefined
Last Comment
RobSampson

8/22/2022 - Mon