Solved

closing a 'pipeline' (open connection to a server share) from VBSCRIPT

Posted on 2004-09-10
4
232 Views
Last Modified: 2010-05-02
Hi all,

I have a problem with a script.
When I copy data from a server share and then delete the share I receive the error:

Err ID: 46 "Permission Denied"

This happens when copying and deleting is done in the same run of the script.

But when I run the script copy, don't delete it works fine
and
when I run the script don't copy/delete it works fine also.

But I want both functions into one run of the script. It looks to me there is still a connection (from the copying) which is not closed, that maybe the reason I receive the error.

I do have enough permissions to copy/delete etc from the server share.

A summary of the code:
==========

<object id="objFSO"             progid="Scripting.FileSystemObject"/>


Set TestFolder = objFSO.GetFolder("\\" & strServernaam & "\" & testfolder) 'This is correct!
IF Err.Number <> 0 THEN
   tsLogFile.WriteLine "    [DeleteShare] ERROR: Error ID: " & Hex(Err.Number) & " " & Err.Description            
   err.clear
ELSE
   err.clear
   TestFolder.Delete
    IF Err.Number <> 0 THEN
      tsLogFile.WriteLine "    [DeleteShare] ERROR: share could not be deleted. Error ID:" & Hex(Err.Number) & " " & Err.Description
    ELSE
      tsLogFile.WriteLine "    [DeleteShare] Success: share succesfully deleted"
   END IF
END IF

==========

The error occurs after the testfolder.delete command. When I put a SLEEP 60000 command before deleting (maybe it needs some time for closing the connection) it does not matter.

Any help? I'm thinking of an open connection... but how to close... Thanks!

Best Regards,

P. Keizer
(the Netherlands)

0
Comment
Question by:keizerpiet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12029364
Set TestFolder = nothing

and then reopen by using

Set TestFolder = objFSO.GetFolder("\\" & strServernaam & "\" & testfolder) 'This is correct!


?
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 500 total points
ID: 12029756
That approach is not likely to work.

MAP the share as a Network work drive and UNMAP after you are done.
0
 

Author Comment

by:keizerpiet
ID: 12042207
the Set Nothing does not work all the time.... I keep something the Permission Denied error.

Mapping could work, but we are not allowed to map drive unfortunately.

Is there a way by viewing active 'pipes' or access made to a drive/folder?

Thanks for the replies so far!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month6 days, 14 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question