M
MikeT
I need to start a lengthy file copy process going on our intranet
server from a .asp page. Since the .asp cannot wait for this to
complete - it might take anything up to half an hour - I've been
trying to use wshShell.Run to start a .wsf script running on the
server itself:
ignore = wshShell.Run("%comspec% /c ""cscript " & scriptpath & " " &
arguments & """", 1, false)
This starts the script OK, and will log what it is doing to a logfile
on the server so I can see what is going on. What I cannot do is
access a UNC share.
From what I can see, if my intranet runs as a pooled thread or as its
own thread, the script gets executed in the user context of the
IWAM_machine account. If I set the intranet to run as part of IIS, it
gets executed under the SYSTEM account. Neither of these have access
to shares in the larger domain, for obvious reasons.
So, is there a better way to start a process going without having to
wait for it to finish under an account that _does_ have rights to
these shares?
I can't really map lots of network drives as there are more potential
share locations than letters in the alphabet and the locations
regularly change. I can't map temporary network drives as multiple
copies of the script may be executing at once. So that's using the
wshNetwork object out the window
I really don't want to have to compile an .exe to do this as keeping
everything as script files makes it much easier to maintain and
update.
server from a .asp page. Since the .asp cannot wait for this to
complete - it might take anything up to half an hour - I've been
trying to use wshShell.Run to start a .wsf script running on the
server itself:
ignore = wshShell.Run("%comspec% /c ""cscript " & scriptpath & " " &
arguments & """", 1, false)
This starts the script OK, and will log what it is doing to a logfile
on the server so I can see what is going on. What I cannot do is
access a UNC share.
From what I can see, if my intranet runs as a pooled thread or as its
own thread, the script gets executed in the user context of the
IWAM_machine account. If I set the intranet to run as part of IIS, it
gets executed under the SYSTEM account. Neither of these have access
to shares in the larger domain, for obvious reasons.
So, is there a better way to start a process going without having to
wait for it to finish under an account that _does_ have rights to
these shares?
I can't really map lots of network drives as there are more potential
share locations than letters in the alphabet and the locations
regularly change. I can't map temporary network drives as multiple
copies of the script may be executing at once. So that's using the
wshNetwork object out the window
I really don't want to have to compile an .exe to do this as keeping
everything as script files makes it much easier to maintain and
update.