For Programmers: Free Programming Magazines  


Home > Archive > ASP > September 2006 > problem running .exe file over network share









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author problem running .exe file over network share
froztbyte

2006-09-28, 6:24 pm

Hi,

I have a very annoying problem in my code below ... This pretty simple script makes a copy of a specified folder from one drive (called O) to another drive (called P), by executing a program (robocopy.exe from Microsoft) within a asp-page using VBScript. I can get this script to run locally on my C-drive, but not over a network share/drive. I believe, I assigned the IUSR_<computername> enough read/write permissions + administrator rights in both IIS and locally on the shared folder, but running the script over a network share/drive still returns a strange error message (see below):

What am I missing here? Any help or hints would be greatly appreciated?

****************************************
****************************************
**************
<pre>
testing ...
folder exists!
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
-------------------------------------------------------------------------------

Started : Fri Sep 29 01:25:59 2006

2006/09/29 01:25:59 ERROR 3 (0x00000003) Getting File System Type of Source O:\Sourcefolder\
The specified folder was not found.

Source - O:\Sourcefolder\
Dest : P:\Destinationfolder\

Files : *.*

Options : *.* /S /E /COPY:DATS /R:3 /W:10

------------------------------------------------------------------------------

NOTE: NTFS Security may not be copied - Source may not be NTFS.

2006/09/29 01:25:59 ERROR 3 (0x00000003) Accessing Source Directory O:\Sourcefolder\
The specified folder was not found.
</pre>
****************************************
****************************************
**************

This is the script:

<pre>
<% @LANGUAGE="VBSCRIPT" %>
<%
Option Explicit
Public filesys, WShshell, strCmd, objTEST, strResult
Public strROBOCOPYtxt: strROBOCOPYtxt = ""

set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FolderExists("O:\Sourcefolder\") Then
strROBOCOPYtxt = strROBOCOPYtxt & "<b>folder exists!</b>"
Else
strROBOCOPYtxt = strROBOCOPYtxt & "<b>folder do not exists!</b>"
End If

set WShshell = CreateObject("WScript.Shell")
strCmd = "C:\robocopy.exe O:\Sourcefolder\ P:\Destinationfolder\ *.* /e /sec /r:3 /w:10"
Set objTEST = WShshell.Exec(strCmd)
strResult = objTEST.StdOut.Readall()
set objTEST = Nothing: Set WShshell = Nothing
strROBOCOPYtxt = strROBOCOPYtxt & replace(strResult, vbCrLf, ">br /<")
%>

<html>
<head><title>testing</title></head>
<body>testing ...<br/><%= strROBOCOPYtxt %></body>
</html>
</pre>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com