Link to home
Start Free TrialLog in
Avatar of Ray Drummond
Ray DrummondFlag for United States of America

asked on

VB Script error

Hey guys.

So, I've been trying to teach myself scripting by looking at my company's existing scripts and attempting to reverse engineer.  I've had some experience with scripting and programming many moons ago, but I can still more or less follow what's going on.

So, I have a maddening issue.  A script created in 2004 by either a former employee or one found on the internet intermittently works.  The job of the script is to take an AD group as input, verify the domain and OU and return a list of accounts in that group.  As I've said, it works sometimes and other times it fails with an access denied message on a specific line.  I've added it below.

Set objGroupLog = fso.CreateTextFile(strGroupLog, True)

This line is in a section where it's trying to write a log, but I'm not sure where it's trying to write to.  I have more lines of the script, but have seen people be annoyed at posters for copy and pasting the entire script.  I can add any info you'd like to give me a hand.
SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ray Drummond

ASKER

Hi Guy.

Thanks for responding.  I think this is the line you're referencing.

strGroupLog = "c:\" & strGroup & "_" & strDateStamp & ".txt"

When I run the script, where I would enter the group name there is a value already listed and I have to delete it and enter the correct group name.
So can you show some group names where your script goes into the error?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So, both of you helped, but it turns out that SirBounty's info is what fixed the issue.  I always commented to colleagues that it always worked on Windows XP.  Forgot about that difference to Windows 7

Thank you both.
Another step closer to understanding this.  Thanks.
Glad you found your solution.  Thanks for the grade! :^)