Re: Problems running remote batch copy from wshshell asp script

From: Baruch Mettler (baruch_at_mettlers.net)
Date: 09/17/04


Date: 17 Sep 2004 09:27:58 -0700

I asked the military, they said I needed to sign something and give
them 4+ years to help me :)

I apologise if my post was off topic. For the life of me I could not
figure out why WScript.Shell running under IIS would behave any
differently than opening a command line and executing a program by
hand. It seems in this case the anonymous user account was not used.
Instead the wshshell.run is ran under the local system account.

After some digging I found others with the same problem in this group
(maybe not all that off topic after all?)

http://groups.google.com/groups?q=wscript.shell+run+as+user&hl=en&lr=&ie=UTF-8&group=microsoft.public.scripting.wsh&selm=737c8591.0108140454.4521b13f%40posting.google.com&rnum=1

And finally this one inspired the hack to get my script working. I
just used the "NET USE" command to attach to the server i need in my
batch file.

http://groups.google.com/groups?q=%22run+as%22+wshshell&hl=en&lr=&ie=UTF-8&group=microsoft.public.scripting.wsh&selm=u%23zKYFBJAHA.222%40cppssbbsa02.microsoft.com&rnum=6

Thanks anyway for looking at it.

-Baruch

"name" <nospam@user.com> wrote in message
news:<eXKo7P7mEHA.2096@TK2MSFTNGP15.phx.gbl>...
> "batch"
> "wshshell "
> "component "
> "ASP "
>
> -----------
>
> Nobody here will translate to first line prerogative.
> As it is totally non GUI in essence.
>
> -------------
>
> I see your three lines of code and
>
> some documented switches thrown in.
>
> ----------------------
>
> Try the military.
>
> Subscribers can choose when they volunteer.
>
>
>
>
>
>
>
>
> "Baruch Mettler" <baruch@mettlers.net> wrote in message
> news:bc74623a.0409150802.2e77191d@posting.google.com...
> > I am trying to make a web interface that users can use to push data
> > from an internal development server a external server. I have been
> > trying to use the wshshell component to kick off a batch script that I
> > have been using successfully by hand. The problem is the batch script
> > runs fine when executed by hand. But when executed in the ASP page
> > only the copy fails, any other command in the file work. After further
> > testing I've noticed local server copies work, but when copying over
> > network shares it fails.
> >
> > Here is my code:
> >
> > push.asp
> > -----------------------
> > Set WshShell = Server.CreateObject("WScript.Shell")
> > wshshell.CurrentDirectory = "q:\ds\wwwroot\push\sitecopy\"
> > WshShell.run "testcopy.bat"
> >
> >
> > testcopy.bat
> > -----------------------
> > :
> > :
> mkdir test5 <--- Works
> > :
> > robocopy.exe \\remotesite1\c$\test\ \\remotesite2\c$\test\ <-- Does
> > not work
> > robocopy.exe c:\test\ c:\test\ <--- Works
> > :
> > xcopy \\remotesite1\c$\test\ \\remotesite2\c$\test\ /C /E /F /H /S /Y
> > ^--- Does not work
> > xcopy c:\test\ c:\test\ /C /E /F /H /S /Y <--- Works
> > :
> > :
> > mkdir test6 <--- Works
> >
> >
> >
> > My guesses at the problem are:
> > - the ASP page does not run under a user with sufficient rights
> > I've checked and double checked. The "account used for anonymous
> > access" in this IIS manager is set to a domain admin account with
> > sufficient access
> > - there is some sort of weird windows security "feature" preventing
> > this sort of action.
> > Can't find any reference to something that would cause this sort of
> > behavior.
> > - No UNC support
> > Mapped the drives and still no luck
> >
> >
> > I am out of ideas as to why this is happening. I would appreciate any
> > pointers anyone may have.
> >
> >
> > Thanks,
> > Baruch Mettler
> >
> >
> >
> > Oh, BTW robocopy.exe is a cool little support tools copy tool. see
> >
> http://www.microsoft.com/resources/documentation/WindowsServ/2003/all/techref/en-us/Default.asp?url=/Resources/Documentation/windowsserv/2003/all/techre
> f/en-us/robocopy.asp



Relevant Pages

  • Re: Problem with Sql Server
    ... The sproc returns data ... > - Executing the command as an sproc by passing the sproc name and the ... > - Executing the command using CommandType.Text and passing the same string ... > - Running both web server and db server on same machine. ...
    (microsoft.public.dotnet.framework.adonet)
  • Problem using exec() from Java servlet
    ... Note that this error ONLY occurs when executing from a servlet. ... I am trying to run the help command on pcli.exe. ... That executable is on a different machine than the server, ...
    (comp.lang.java.help)
  • SQL server 2000
    ... osql command is not executing on Remote server ... After executing the above command I got time out expire messsage ... It is noted that 35 server is connected with the gateway where the osql ...
    (comp.databases.ms-sqlserver)
  • Problem with Sql Server
    ... - Executing the command as an sproc by passing the sproc name and the parameters to the executedataset method. ... - Executing the command by creating my own SqlCommand and other objects directly. ... - Running both web server and db server on same machine. ...
    (microsoft.public.dotnet.framework.adonet)
  • Rebooting 2003 server automatically?
    ... I used to run shutdown.exe with a batch script via the AT command in Server ... 2000, but now that I'm upgrading to Server 2003, it appears that batch files ...
    (microsoft.public.win2000.general)