security - web service - vb.net - Help....

A

arth

Hi,

I have set up a web service which instantiates a class in a vb.net dll.

One of the things the class is required to do is copy a network folder. The
destination might be the same or a different server.

I have tried using Shell(<command string> etc) and
System.Diagnostics.Process.Start(<command string>) to run the command to
accomplish this. Both ways do not error but no folder/files get copied.

If I type the command in a command window it executes successfully - folder
created and files copied. An example of the command I am using is:

"xcopy \\servername1\share$\foldername1\foldername2\thisfolder
\\server2\share2$\foldername3\foldername4\thisfolder /E /K /R /O /H /I /Y"

The .asmx page is set for anonymous access and to use the same account that
I am logged on as when the command works from a command window. Web.config
is also set up with <Identity impersonate=true />. The identity used is a
Domain Admin.

If I change the "xcopy" to, for example, "xxcopy" I get the expected "File
not found" error so I guess Shell() and process.start() are at least having
a go.

Anyone able to point me in a direction to solve this?

Thanks for your time if you think about it and apologies if posted in wrong
group(s).

Arth.
 
M

Martin Kulov

arth said:
Hi,

I have set up a web service which instantiates a class in a vb.net dll.

One of the things the class is required to do is copy a network folder.
The destination might be the same or a different server.

I have tried using Shell(<command string> etc) and
System.Diagnostics.Process.Start(<command string>) to run the command to
accomplish this. Both ways do not error but no folder/files get copied.

If I type the command in a command window it executes successfully -
folder created and files copied. An example of the command I am using is:

"xcopy \\servername1\share$\foldername1\foldername2\thisfolder
\\server2\share2$\foldername3\foldername4\thisfolder /E /K /R /O /H /I /Y"

The .asmx page is set for anonymous access and to use the same account
that I am logged on as when the command works from a command window.
Web.config is also set up with <Identity impersonate=true />. The
identity used is a Domain Admin.

If I change the "xcopy" to, for example, "xxcopy" I get the expected "File
not found" error so I guess Shell() and process.start() are at least
having a go.

Anyone able to point me in a direction to solve this?

Thanks for your time if you think about it and apologies if posted in
wrong group(s).

Arth.

Hi Arth,

One tip:
Start .bat file and print out the current working directory to see where are
you actually running at. Use pause command to see the results.

HTH,


--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top