Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Temp file not found after it was created

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61977
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Temp file not found after it was created
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Temp file not found after it was created - 6/29/2008 8:43:50 PM   
  asgaroth

 

Posts: 12
Score: 0
Joined: 5/14/2008
Status: offline
Hi again!

I have a strange problem with a logon script i'm currently writing!

I use the following commands to create a temporary file which contains all the mapped drives:


      


This works fine on a local machine... but when i put it in a folder on the server
and then execute this script by a batch file on system logon
(added this as logon script in active directory)

It always says "error opening tmpfile: xyz123"!
If i then cd to the temp folder, there is a file called xyz123 and it has the current net use output in it....

Is my script maybe to fast? I mean that the file wasn't yet created but the script wants to read it?

Or the tempfile the script wants to load is not the tempfile the script creates...
I mean, maybe the script wants to load the tempfile from the servers temp directory and the tempfile the script creates is in the local temp directory...
But then again... the script is executed locally i think... so it HAS to use the local temp directory...

Thanks in advance for answers.
                 Asgaroth
 
 
Post #: 1
 
 RE: Temp file not found after it was created - 6/30/2008 3:53:10 PM   
  djredmar


Posts: 55
Score: 0
Joined: 12/11/2006
From: Europe, The Netherlands
Status: offline
change the following line:
wshShell.run "%comspec% /c net use > " & tmpfilename,0

into
wshShell.run "%comspec% /c net use > " & tmpfilename,0, true

true means 'wait for return'


Edit:
uhmm... no wshell object defined?

Dim wshShell : Set wshShell = CreateObject("Wscript.shell")

< Message edited by djredmar -- 6/30/2008 3:54:17 PM >

(in reply to asgaroth)
 
 
Post #: 2
 
 RE: Temp file not found after it was created - 7/1/2008 8:55:39 PM   
  asgaroth

 

Posts: 12
Score: 0
Joined: 5/14/2008
Status: offline
I have a shellObject defined... this code was just a snippet of the whole code...

That wait for return thing seems to help! I'll report back if it comes to any further error!

Thanks for your help!

Asgaroth

(in reply to djredmar)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Temp file not found after it was created Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts