HighDots Forums  

Delete folder on Network Drive

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Delete folder on Network Drive in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
treasonftg@gmail.com
 
Posts: n/a

Default Delete folder on Network Drive - 07-29-2006 , 08:45 PM






I want to delete a folder on a network drive through jscript. I have
tried everything and I can't delete and folders on that drive. I have
tried the fileSystem object and WScript.Shell. Nothing will erase it.
the folders exists and my paths are correct but I cant delete. Using
windows explorer, I can delete with no problem. Using DOS, no problem.
Using VB6 with FSO or WinAPI's, no problem again. But when I try any of
these methods from jscript it wont erase. It says path not found. But
that doesnt make sense because I check to see if the folderexists
first, and it returns true!

I even wrote an exe in VB6 to erase it, and it works great from
windows. BUT when i shell to the exe in jscript, it fails!

I have shown the "My Computer Zone" in Internet Explorer, and enabled
as much stuff as I thought needed. I am stupmed. My only guess is when
I run things through explorer, I have a different set of user rights,
than when I run things from the browser.

Any Ideas?!?


Reply With Quote
  #2  
Old   
Rob Williscroft
 
Posts: n/a

Default Re: Delete folder on Network Drive - 07-30-2006 , 07:37 AM






wrote in news:1154220313.303954.324470 (AT) m73g2000cwd (DOT) googlegroups.com in
alt.comp.lang.javascript:

Quote:
I want to delete a folder on a network drive through jscript. I have
tried everything and I can't delete and folders on that drive. I have
tried the fileSystem object and WScript.Shell. Nothing will erase it.
the folders exists and my paths are correct but I cant delete. Using
windows explorer, I can delete with no problem. Using DOS, no problem.
Using VB6 with FSO or WinAPI's, no problem again. But when I try any of
these methods from jscript it wont erase. It says path not found. But
that doesnt make sense because I check to see if the folderexists
first, and it returns true!

I even wrote an exe in VB6 to erase it, and it works great from
windows. BUT when i shell to the exe in jscript, it fails!

I have shown the "My Computer Zone" in Internet Explorer, and enabled
as much stuff as I thought needed. I am stupmed. My only guess is when
I run things through explorer, I have a different set of user rights,
than when I run things from the browser.
Absolutly, when you run a .js file by clicking in explorer it
just calls wscript.exe to run the script, it has nothing to
do with IE or your internet security settings.

You should reset those settings.

Quote:
Any Ideas?!?
More of a wild guess realy.

Are you doubling the backslashes \'s ?, i.e:

var folder_to_delete = "\\\\ShareName\\folder\\folder";

Rob.
--
http://www.victim-prime.dsl.pipex.com/


Reply With Quote
  #3  
Old   
Treason
 
Posts: n/a

Default Re: Delete folder on Network Drive - 07-30-2006 , 05:37 PM




Rob Williscroft wrote:
Quote:
wrote in news:1154220313.303954.324470 (AT) m73g2000cwd (DOT) googlegroups.com in
alt.comp.lang.javascript:

I want to delete a folder on a network drive through jscript. I have
tried everything and I can't delete and folders on that drive. I have
tried the fileSystem object and WScript.Shell. Nothing will erase it.
the folders exists and my paths are correct but I cant delete. Using
windows explorer, I can delete with no problem. Using DOS, no problem.
Using VB6 with FSO or WinAPI's, no problem again. But when I try any of
these methods from jscript it wont erase. It says path not found. But
that doesnt make sense because I check to see if the folderexists
first, and it returns true!

I even wrote an exe in VB6 to erase it, and it works great from
windows. BUT when i shell to the exe in jscript, it fails!

I have shown the "My Computer Zone" in Internet Explorer, and enabled
as much stuff as I thought needed. I am stupmed. My only guess is when
I run things through explorer, I have a different set of user rights,
than when I run things from the browser.

Absolutly, when you run a .js file by clicking in explorer it
just calls wscript.exe to run the script, it has nothing to
do with IE or your internet security settings.

You should reset those settings.


Any Ideas?!?

More of a wild guess realy.

Are you doubling the backslashes \'s ?, i.e:

var folder_to_delete = "\\\\ShareName\\folder\\folder";

Rob.
--
http://www.victim-prime.dsl.pipex.com/
Thanks for the responce rob

I did try to double the slashes.. with no luck

I am not using a UNC path I am using a network drive

Z:\temp for ezample

would this change anything?



Reply With Quote
  #4  
Old   
Rob Williscroft
 
Posts: n/a

Default Re: Delete folder on Network Drive - 07-30-2006 , 08:08 PM



Treason wrote in
news:1154295473.683183.307640 (AT) b28g2000cwb (DOT) googlegroups.com in
alt.comp.lang.javascript:

Quote:
Rob Williscroft wrote:
wrote in news:1154220313.303954.324470 (AT) m73g2000cwd (DOT) googlegroups.com
in alt.comp.lang.javascript:

I want to delete a folder on a network drive through jscript. I


Any Ideas?!?

More of a wild guess realy.

Are you doubling the backslashes \'s ?, i.e:

var folder_to_delete = "\\\\ShareName\\folder\\folder";

Rob.
--
http://www.victim-prime.dsl.pipex.com/

Thanks for the responce rob

I did try to double the slashes.. with no luck

I am not using a UNC path I am using a network drive

Z:\temp for ezample

would this change anything?

Well the string that you pass to fso.DeleteFolder() still needs
the backslash doubling:

var fso = new ActiveXObject( "Scripting.FileSystemObject" );
fso.DeleteFolder( "z:\\temp", true );

For a complete list of JScript escapes:

<url:http://msdn.microsoft.com/library/de...l=/library/en-
us/script56/html/3b38b1bd-1f0f-4748-b13e-55cab36fd126.asp>

As a Tiny URL: http://tinyurl.com/kx4d8

Rob.
--
http://www.victim-prime.dsl.pipex.com/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.