JScript to delete file to Recycling Bin

JScript to delete file to Recycling Bin

Post by LSVCQDCDKB » Wed, 10 Nov 2004 17:58:42


I'd really appreciate it if someone could provide me an example
JScript that deletes a file to the recycling bin.

Thanks in advance!
 
 
 

JScript to delete file to Recycling Bin

Post by MV » Thu, 11 Nov 2004 00:13:15

> I'd really appreciate it if someone could provide me an example


FSO (Scripting.FileSystemObject) methods that you would use from script to
do folder/file deletes do not support the recycle bin. Off hand, I don't
know of any 3rd party components that support file maintenance with recycle
bin support, though I assume they exist.


--
Michael Harris
Microsoft.MVP.Scripting

 
 
 

JScript to delete file to Recycling Bin

Post by Dave Ander » Thu, 11 Nov 2004 00:37:19


Which recycling bin would you put it in? (HINT: there is one for each user
account)



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
 
 

JScript to delete file to Recycling Bin

Post by Christoph » Thu, 11 Nov 2004 10:39:16

09.11.2004 09:58, Jesse Bavage schrieb:


You could play around with ShellFolder and InvokeVerb.
But that's ugly (locale strings with ampersand-position
depending on os-version)
For a better solution look for component that wraps
SHEmptyRecycleBin & SHQueryRecycleBin.

--
Gruesse, Christoph

Rio Riay Riayo - Gordon Sumner, 1979
 
 
 

JScript to delete file to Recycling Bin

Post by LSVCQDCDKB » Thu, 11 Nov 2004 13:10:00

hey guys, thanks for the responses. to add a little more, my
impression was similiar to Michael's. thought i've seen some ways to
do it using VBScript which I know is not the same thing. but often
scripting examples on msdn show both the vbs and js ways of doing the
same thing.

along dave's line of thought, i had been thinking about *moving*
instead of deleting the files to the recycle bin. but i wasn't sure if
a., i could, or b., whether these files would really be considered
deleted and get cleaned up if i emptyed the recycle bin.

to dave's question, i guess i'd be happy with any recycle bin, the
administrator's, the current user's, a specific username of my
choosing. if you know how to do this, please do let me know.

here's the link that i thought might provide some cryptic answers:

http://www.yqcomputer.com/

i need to write a wrapper to "SHFileOperation" to make it accessible
to jscript. thoughts?

thanks again!
 
 
 

JScript to delete file to Recycling Bin

Post by MV » Fri, 12 Nov 2004 00:36:22

> i need to write a wrapper to "SHFileOperation" to make it accessible


You might want to look through these past threads...

Google Search: SHFileOperation group:*.scripting
http://www.yqcomputer.com/ %20group:*.scripting&num=100&scoring=d


--
Michael Harris
Microsoft.MVP.Scripting