Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Copying files from a server to another (http://www.velocityreviews.com/forums/t798944-copying-files-from-a-server-to-another.html)

KK 06-14-2005 05:31 PM

Copying files from a server to another
 
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


Patrice 06-14-2005 05:37 PM

Re: Copying files from a server to another
 
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:EDE422F4-B38A-43A5-9BD3-49E4345735A0@microsoft.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
>




KK 06-14-2005 05:47 PM

Re: Copying files from a server to another
 
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:EDE422F4-B38A-43A5-9BD3-49E4345735A0@microsoft.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
> >

>
>
>


Tom Kaminski [MVP] 06-14-2005 06:12 PM

Re: Copying files from a server to another
 
"KK" <KK@discussions.microsoft.com> wrote in message
news:A2800D3C-E639-40C7-B58A-7D3A3A43738E@microsoft.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



KK 06-14-2005 06:28 PM

Re: Copying files from a server to another
 
I changed it to d$, but that did not help either.

"Tom Kaminski [MVP]" wrote:

> "KK" <KK@discussions.microsoft.com> wrote in message
> news:A2800D3C-E639-40C7-B58A-7D3A3A43738E@microsoft.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
>
>
>


Curt_C [MVP] 06-14-2005 06:39 PM

Re: Copying files from a server to another
 
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:A2800D3C-E639-40C7-B58A-7D3A3A43738E@microsoft.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

Bob Barrows [MVP] 06-14-2005 07:18 PM

Re: Copying files from a server to another
 
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.



Curt_C [MVP] 06-14-2005 07:29 PM

Re: Copying files from a server to another
 
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

KK 06-14-2005 08:29 PM

Re: Copying files from a server to another
 
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
>


Curt_C [MVP] 06-14-2005 08:47 PM

Re: Copying files from a server to another
 
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
>>



All times are GMT. The time now is 07:56 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.