Solved

How to delete Server files/folders from LAN user (JavaScript)

Posted on 2008-06-21
4
579 Views
Last Modified: 2008-07-04
Prgram runs successfully, using user disk partition as server emulation.  When LAN connected, files/folders are sucessfully copied to sever.  However, the following code returns an error when interacting with server (but not with files on user PC):

GLOBALS:
gpath='';  // this is given value prior to calling "DeleteFile()
fso = new ActiveXObject("Scripting.FileSystemObject");
 
function DeleteFile() {
      if (fso.FileExists(gpath)) {var afile = fso.GetFile(gpath); afile.Delete();}
}

Even when full administrator rights are given, the error still occurs.
Your input will be valued.
0
Comment
Question by:nyoka
  • 3
4 Comments
 
LVL 7

Expert Comment

by:kGenius
Comment Utility
what's the exact error?
Karl
0
 

Author Comment

by:nyoka
Comment Utility
Regret, unknown.  However line number refers to the above code.   Will only be able to check on Monday.  "Permission denied" is probable.
Keith
0
 

Author Comment

by:nyoka
Comment Utility
Karl, Tested using Kingston flash disk in user PC, acting as server drive.  With Vista Home Basic and Vista Home premium, IE7, all works OK.  With XP SP2, fails: "could not read the size property".  Retry="permission denied".  Inspection with Windows Explorer shows file not deleted from Kingston.  Seems to be XP-related.  XP IE 6  Intranet & Local set to 'Low'.
Are there any XP tweaks one requires?
0
 

Accepted Solution

by:
nyoka earned 0 total points
Comment Utility
Karl,  No reply from you.

Anyway, after much experimentation, an XP/Windows 2003 server bug was found:  Cannot change read-only settings on files, using Windows Explorer.  One can set them once, and then they revert to Read-only.  Using the "Start-up, Run, Cmd, attrib -r +s path\folder" routine enabled permanent Read-only Clear on the required folders on User & Server.  Problem solved.

Refer Microsoft support article No 326549, which provides a work-around.  They admit nothing - say this behaviour is by design.  However, they appear to have eliminated the problem in the two versions of Vista I tested!

Suggest this thread be closed.  Awarding of points does not seem appropriate in this case.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now