Solved

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

Posted on 2008-06-21
4
581 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
ID: 21837413
what's the exact error?
Karl
0
 

Author Comment

by:nyoka
ID: 21837456
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
ID: 21844632
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
ID: 21880931
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

825 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