473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Copying files from a server to another

KK
Hello,

I am running into a problem for copying files between 2 different servers.
I am using the following lines of code to do that, but I get a 'permission
denied' error

Set fso = Server.CreateObject("Scripting.FileSystemObject")
strSourceFile = "\\server1\file1.doc"
strDestFile = "\\server2\file1.doc"
fso.CopyFile strSourceFile,strDestFile, true

Please advise

Thanks in advance
KK

Jul 22 '05 #1
11 2093
Looks like the share name is missing. You have just a server name and a file
?

Patrice

--

"KK" <KK@discussions.microsoft.com> a écrit dans le message de
news:ED**********************************@microsof t.com...
Hello,

I am running into a problem for copying files between 2 different servers.
I am using the following lines of code to do that, but I get a 'permission
denied' error

Set fso = Server.CreateObject("Scripting.FileSystemObject")
strSourceFile = "\\server1\file1.doc"
strDestFile = "\\server2\file1.doc"
fso.CopyFile strSourceFile,strDestFile, true

Please advise

Thanks in advance
KK

Jul 22 '05 #2
KK
Sorry, I missed the share.
strSourceFile = "\\server1\c$\file1.doc"
strDestFile = "\\server2\c$\file1.doc"
But that does not solve the problem...
"Patrice" wrote:
Looks like the share name is missing. You have just a server name and a file
?

Patrice

--

"KK" <KK@discussions.microsoft.com> a écrit dans le message de
news:ED**********************************@microsof t.com...
Hello,

I am running into a problem for copying files between 2 different servers.
I am using the following lines of code to do that, but I get a 'permission
denied' error

Set fso = Server.CreateObject("Scripting.FileSystemObject")
strSourceFile = "\\server1\file1.doc"
strDestFile = "\\server2\file1.doc"
fso.CopyFile strSourceFile,strDestFile, true

Please advise

Thanks in advance
KK


Jul 22 '05 #3
"KK" <KK@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Sorry, I missed the share.
strSourceFile = "\\server1\c$\file1.doc"
strDestFile = "\\server2\c$\file1.doc"
But that does not solve the problem...


"C$" is a hidden share only accessible to administrators. I would suggest
creating a different share specifically for your web app.

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
Jul 22 '05 #4
KK
I changed it to d$, but that did not help either.

"Tom Kaminski [MVP]" wrote:
"KK" <KK@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Sorry, I missed the share.
strSourceFile = "\\server1\c$\file1.doc"
strDestFile = "\\server2\c$\file1.doc"
But that does not solve the problem...


"C$" is a hidden share only accessible to administrators. I would suggest
creating a different share specifically for your web app.

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS

Jul 22 '05 #5
KK wrote:
I changed it to d$, but that did not help either.

"Tom Kaminski [MVP]" wrote:

"KK" <KK@discussions.microsoft.com> wrote in message
news:A2**********************************@micros oft.com...
Sorry, I missed the share.
strSourceFile = "\\server1\c$\file1.doc"
strDestFile = "\\server2\c$\file1.doc"
But that does not solve the problem...


"C$" is a hidden share only accessible to administrators. I would suggest
creating a different share specifically for your web app.

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS

all $ shares are special, try a NON admin (non $) share

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Jul 22 '05 #6
Curt_C [MVP] wrote:

all $ shares are special, try a NON admin (non $) share


Not quite. "$" just means the share is hidden. As long as users have
permissions to use them, they should be able to: admin or not.

It is true that the c$, d$, etc shares created by default are limited to
admin users. But shares with names ending with "$" can be created on
subfolders, and permissions for them can be granted to non-admin users. The
shares will be hidden from view to users who have not been granted
permissions to use those shares.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #7
Bob Barrows [MVP] wrote:
Curt_C [MVP] wrote:
all $ shares are special, try a NON admin (non $) share

Not quite. "$" just means the share is hidden. As long as users have
permissions to use them, they should be able to: admin or not.

It is true that the c$, d$, etc shares created by default are limited to
admin users. But shares with names ending with "$" can be created on
subfolders, and permissions for them can be granted to non-admin users. The
shares will be hidden from view to users who have not been granted
permissions to use those shares.

Bob Barrows

You misinterpreted...
Just meant $ were special (hidden) not that they are ADMIN. the c$/f$
are Admin I'm betting. Meant to say "try a non $ AND a non-admin" share :}

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Jul 22 '05 #8
KK
As far as I know the problem seems to be of granting permissions for the
account used by IIS on server2. I tried giving IUSR_Server1 full access, but
that did not help

"Curt_C [MVP]" wrote:
Bob Barrows [MVP] wrote:
Curt_C [MVP] wrote:
all $ shares are special, try a NON admin (non $) share

Not quite. "$" just means the share is hidden. As long as users have
permissions to use them, they should be able to: admin or not.

It is true that the c$, d$, etc shares created by default are limited to
admin users. But shares with names ending with "$" can be created on
subfolders, and permissions for them can be granted to non-admin users. The
shares will be hidden from view to users who have not been granted
permissions to use those shares.

Bob Barrows

You misinterpreted...
Just meant $ were special (hidden) not that they are ADMIN. the c$/f$
are Admin I'm betting. Meant to say "try a non $ AND a non-admin" share :}

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Jul 22 '05 #9
Full access to the SHARE or to the Folder/File? These are different things.
Try using a regular user (preferably and Admin account) as a test once.
This will tell you if its a permissions thing.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
KK wrote:
As far as I know the problem seems to be of granting permissions for the
account used by IIS on server2. I tried giving IUSR_Server1 full access, but
that did not help

"Curt_C [MVP]" wrote:

Bob Barrows [MVP] wrote:
Curt_C [MVP] wrote:
all $ shares are special, try a NON admin (non $) share

Not quite. "$" just means the share is hidden. As long as users have
permissions to use them, they should be able to: admin or not.

It is true that the c$, d$, etc shares created by default are limited to
admin users. But shares with names ending with "$" can be created on
subfolders, and permissions for them can be granted to non-admin users. The
shares will be hidden from view to users who have not been granted
permissions to use those shares.

Bob Barrows


You misinterpreted...
Just meant $ were special (hidden) not that they are ADMIN. the c$/f$
are Admin I'm betting. Meant to say "try a non $ AND a non-admin" share :}

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Jul 22 '05 #10
"KK" wrote in message
news:E9**********************************@microsof t.com...
: As far as I know the problem seems to be of granting permissions for the
: account used by IIS on server2. I tried giving IUSR_Server1 full access,
but
: that did not help

Permissions are more difficult when it's on an Intranet and the anonymous
user is enabled. Since you're using the anonymous user, you then need to
make sure anyone that has rights (LAN) does not connect to IIS on a link
that uses their credentials. They must first connect as an anonymous user.
Your log should show how they're connecting, which will show why they're
being denied.

Surely you're not giving the anonymous user rights to d$, which would then
require propagating that down the tree to the necessary path required.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #11
Plan B then ;-)

Likely really a permission problem :
- check the account under which runs your page (usually IUSR_<machine> if
anonymous, or under the user account if authenticated)
- check that this account is allowed to access this share as well as the
underlying files (unlikely as they are admin shares).

I would create my own shares and would grant access to the needed account
(or group).

Patrice

--

"KK" <KK@discussions.microsoft.com> a écrit dans le message de
news:A2**********************************@microsof t.com...
Sorry, I missed the share.
strSourceFile = "\\server1\c$\file1.doc"
strDestFile = "\\server2\c$\file1.doc"
But that does not solve the problem...
"Patrice" wrote:
Looks like the share name is missing. You have just a server name and a file ?

Patrice

--

"KK" <KK@discussions.microsoft.com> a écrit dans le message de
news:ED**********************************@microsof t.com...
Hello,

I am running into a problem for copying files between 2 different servers. I am using the following lines of code to do that, but I get a 'permission denied' error

Set fso = Server.CreateObject("Scripting.FileSystemObject")
strSourceFile = "\\server1\file1.doc"
strDestFile = "\\server2\file1.doc"
fso.CopyFile strSourceFile,strDestFile, true

Please advise

Thanks in advance
KK


Jul 22 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
1
by: Sarah | last post by:
Hi, Can someone please tell me if there's a way to copy image files from one server to another using ASP and FSO? Or perhaps some other way to do it? I'm trying to collect information on...
2
by: Peter Sands | last post by:
Hi, I am testing out some restores to a stand-by server, by roll-forwading the logs. I have this setup. There is no user-exit, but logretain is on, for archive logging. I have 2 DB's on...
2
by: Stefan Schneider | last post by:
Hi, I have to copy an existing database from one Windows-Server to another one. The source database is a 8.1.0 database on a Windows 2000 Server, the destination database will be a newer 8.x...
0
by: TB | last post by:
Hi All: This news group is proving to be great help on my path towards mastering ASP.NET thanks to all of you helpful souls out there. I am looking forward to the day when I can contribute with...
5
by: TB | last post by:
Hi All: This news group is proving to be great help on my path towards mastering ASP.NET thanks to all of you helpful souls out there. I am looking forward to the day when I can contribute...
4
by: zMisc | last post by:
Is it possible to copy a table from one schema to another schema by just copying the frm file to the directory for the new schema? What is the best way to create a new database with all the...
6
by: Jim Heavey | last post by:
I have written a little application which copies files from one location to another location. Before it copies the file, it ensure the directory for both the from and to locations is valid. It...
13
by: writeson | last post by:
Hi all, I'm writing some code that monitors a directory for the appearance of files from a workflow. When those files appear I write a command file to a device that tells the device how to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.