Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2004, 06:07 AM
Authorized User
 
Join Date: Mar 2004
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....

 
Old April 23rd, 2004, 08:08 AM
Registered User
 
Join Date: Jun 2003
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
 
Old April 26th, 2004, 02:22 AM
Authorized User
 
Join Date: Mar 2004
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....


 
Old April 26th, 2004, 12:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well, what kind of error do you get?
Marco
 
Old April 27th, 2004, 04:19 AM
Authorized User
 
Join Date: Mar 2004
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.

 
Old April 27th, 2004, 09:25 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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?

 
Old April 27th, 2004, 11:21 AM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old April 28th, 2004, 01:35 AM
Authorized User
 
Join Date: Mar 2004
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.






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.