Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 23rd, 2004, 06:07 AM
Authorized User
 
Join Date: Mar 2004
Location: Ranchi, Jharkhand, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default File System Object

Hi,
I am using VB 6 to generate a configuration file.
I have to copy this file to different machines in the n/w, and for the same i am using
fso.CopyFile "d:\sms\sample.ccr", strLoc & "sample.ccr" line where sample.ccr is a file name and strloc contains the path
e.g. \\16.112.30.2\c$\temp

But this is not working i already checked for permissions in those PC, rather i am using this from administrator login who has all permission for those PC's.
I need urgent help.

Any body....plz....

Reply With Quote
  #2 (permalink)  
Old April 23rd, 2004, 08:08 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

fso.CopyFile "d:\sms\sample.ccr", strLoc & "sample.ccr"

You are missing the last path "\"

fso.CopyFile "d:\sms\sample.ccr", strLoc & "\sample.ccr"

Hope this helps you
Reply With Quote
  #3 (permalink)  
Old April 26th, 2004, 02:22 AM
Authorized User
 
Join Date: Mar 2004
Location: Ranchi, Jharkhand, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, actually that was a typo in forum text, i am using it as
strLoc = "\\pai820smspag01\cap_all\ccr.box\"

and then fso.CopyFile "d:\sms\sample.ccr", strLoc & "sample.ccr".

I have also tried with
fso.CopyFile "d:\sms\sample.ccr", "\\pai820smspag01\cap_all\ccr.box\sample.ccr".

Looking for your help....


Reply With Quote
  #4 (permalink)  
Old April 26th, 2004, 12:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well, what kind of error do you get?
Marco
Reply With Quote
  #5 (permalink)  
Old April 27th, 2004, 04:19 AM
Authorized User
 
Join Date: Mar 2004
Location: Ranchi, Jharkhand, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
In my application i am simply using this line
fso.CopyFile "d:\sms\sample.ccr", strLoc & "sample.ccr"

If i am writing like this strloc="d:\" then its working perfectly and copying file into local D drive but when i am putting strloc="\\pai820smspag01\cap_all\ccr.box\sample.cc r", nither its showing any error msg nor copying the file at the said location.
I am using this program from admin login and have checked for all permissions.

Reply With Quote
  #6 (permalink)  
Old April 27th, 2004, 09:25 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Can this be caused by the fact that in your second example, strLoc doesn't hold a foldername, but a file and foldername?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: 15 - Coma by Guns N' Roses (Track 15 from the album: Use Your Illusion 1) What's This?

Reply With Quote
  #7 (permalink)  
Old April 27th, 2004, 11:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The admin account in your computer may be not an administator for the remote server. FSO is picky about it, read this:
http://support.microsoft.com/default...b;EN-US;197964
The bad with SFO is that does not throw any errors, just abort the operation on the first error (I just checked it)
Did you try to shell the command?
Shell "copy " & srcFile & " " & dstFile?
Did you try the CopyFIle API (at least that gives yoy an error code...

Marco
Reply With Quote
  #8 (permalink)  
Old April 28th, 2004, 01:35 AM
Authorized User
 
Join Date: Mar 2004
Location: Ranchi, Jharkhand, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Answer for Imar's:

When i specified filename together with foldername i passed only strloc without the file name in quotes.
When i used strloc actual implemented code is like this

strLoc = "\\pai820smspag01\cap_all\ccr.box\"
fso.CopyFile "d:\sms\sample.ccr", strLoc & "sample.ccr".

When i tried without strloc, its like this only
fso.CopyFile "d:\sms\sample.ccr", "\\pai820smspag01\cap_all\ccr.box\sample.ccr".


Answer for marcostraf:

No ihaven't used shell and API in my code till now, thanks for suggestion. i hope this will work.

Rajesh.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File System Object question fogofogo Classic ASP Basics 1 December 8th, 2005 04:14 PM
File System Object Permissions kilika Classic ASP Basics 2 August 6th, 2003 09:23 AM



All times are GMT -4. The time now is 03:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.