Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 17th, 2005, 6:56 AM   #1
FelixM
Newbie
 
Join Date: May 2005
Posts: 7
Rep Power: 0 FelixM is on a distinguished road
File is not saving to this location

If I remove "K:\General\IT\Assets" it saves the file in the directory where the script is run. I want it saving to a remote locatin. What's wrong with the way I've set the path?

set outFile= FSobj.CreateTextFile("K:\General\IT\Assets" & strComputer &".txt", 2, True)
outFile.write strMsg
outFile.Close
FelixM is offline   Reply With Quote
Old May 17th, 2005, 8:45 AM   #2
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
you sure you have write access to the remote location? If so try creating the file on the local filesystem and if that works hmmm i am not to sure.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old May 17th, 2005, 9:09 AM   #3
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Try chdiring to the folder first. Or use the WSO IsFolder() function first.
Rory is offline   Reply With Quote
Old May 17th, 2005, 9:33 AM   #4
FelixM
Newbie
 
Join Date: May 2005
Posts: 7
Rep Power: 0 FelixM is on a distinguished road
I have write access to folder.
Cant figure out how to use WSO IsFolder() yet but am looking at.
FelixM is offline   Reply With Quote
Old May 18th, 2005, 2:29 PM   #5
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Sorry, using the FSO:
FileSystemObject.FolderExists()
All of the FSO's methods are relevant to the current folder (like DOS, VB is pointing at a folder at any moment in time). You need to ChDir("Path") to the folder first: this will ensure that if the file can't be created it won't default back to the script's home folder.
Rory is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC