Wrox Programmer Forums
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 28th, 2006, 08:26 PM
Registered User
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default running ROBOCOPY on network share?


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?

************************************************** ********************************************
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:\SourcefolderThe specified folder was not found.

Source - O:\SourcefolderDest : 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:\SourcefolderThe specified folder was not found.
************************************************** ********************************************

This is the script:

    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>"
        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 /<")

<body>testing ...<br/><%= strROBOCOPYtxt %></body>

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a program off the network? myurick Visual Basic 2008 Essentials 4 April 3rd, 2008 02:22 PM
Problem running Application on network hellian Apache Tomcat 1 June 7th, 2007 11:44 PM
Accessing Network Share with Access VBA JonniP Access 15 January 5th, 2007 01:57 PM
Creating folders on network share JonniP Access VBA 1 January 3rd, 2007 03:51 PM
how to share a folder mqnguyen Classic ASP Basics 2 August 6th, 2003 01:23 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.