Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenTextFile

Status
Not open for further replies.

britney

Technical User
Nov 6, 2001
4
GB
Hi,
Please can someone suggest where I'm going wrong?
Running Windows ME and Scripting 5.5

I have a bat file which runs winipcfg /Batch , and
then calls wscript to run a vbs script, which attempts to open
the resultant winipcfg.out file with OpenTextFile.

If I run it by double-clicking on the bat file icon,all
is sweetness and light, works like a dream. But if I set up the
Task Scheduler to run the bat file at startup, the OpenTextFile
returns a permissions error.
Is this a user permissions issue?
Any suggestions please? I expect the first could be
"run windows 2000" but I only have a little machine unfortunately.
Thanks,
Britney
 
Are you trying to write this text file to a network path, or to the local drive?
 
Thanks for the reply . The file gets written OK to the hard drive
by winipcfg. It is when I try to open it for reading that it gets the
permissions error, but only if it is being run from the Task Scheduler at startup.
Thanks.
 
i'm kind of at a loss for what to suggest, but here's a couple of things that might be able to help troubleshoot a little bit.

try creating a new text file (blank) with VBScript/WSH in your startup script to see if you can even create the necessary object. or do something else to verify that you can create the object, like get some file information, date created, or something.

if you can create the object above, then see if you can GetFile the file in question and make a copy of it.

This article below MIGHT possibly be able to help, but there's no way of knowing unless you have a subscription to the site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top