PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

"Delete" files by moving it to the Trash Can/Recycler from the command line?

 
 
per9000
Guest
Posts: n/a
 
      21st Nov 2006
Hi all,

I work a lot in windows from the command line. I'd like to be able to,
instead of only deleting a file (f.x. "del *.tmp") be able to move it
to the trashcan.

I could just move to C:\MyTrashCan, but I'd like it to be able to
browse, and preferably replace files later with the standard trash can
view.

Thanks,
Per

 
Reply With Quote
 
 
 
 
Wesley Vogel
Guest
Posts: n/a
 
      21st Nov 2006
Move
Moves one or more files from one directory to the specified directory.

Type in a command prompt: Move /?

More Move HELP.
Paste the following line into Start | Run and click OK...

hh ntcmds.chm::/move.htm

Each hard disk or partition contains a hidden folder named Recycler. The
Recycler folder is used only on NTFS partitions. On FAT32 the RECYCLED
folder is used. The Recycler folder contains a Recycle Bin for each user
that logs on to the computer, sorted by their security identifier (SID).

My hard drive is formatted NTFS.

This is MY SID #
S-1-5-21-1708537768-15xx36667-1202660629-1003

This is MY Recycle Bin
C:\RECYCLER\S-1-5-21-1708537768-15xx36667-1202660629-1003

Your Recycle Bin would be similar, but you need to know your SID #.

This registry key lists all of the SIDs.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

To tell which user has which SID, click on each SID, look at
ProfileImagePath, the Data has the user name at the end of the path. I.e.
%SystemDrive%\Documents and Settings\Wesley P. Vogel

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:(E-Mail Removed),
per9000 <(E-Mail Removed)> hunted and pecked:
> Hi all,
>
> I work a lot in windows from the command line. I'd like to be able to,
> instead of only deleting a file (f.x. "del *.tmp") be able to move it
> to the trashcan.
>
> I could just move to C:\MyTrashCan, but I'd like it to be able to
> browse, and preferably replace files later with the standard trash can
> view.
>
> Thanks,
> Per

 
Reply With Quote
 
per9000
Guest
Posts: n/a
 
      22nd Nov 2006
Hi Wesley,

yes, indeed this seems to move files to the trashcan-folder. From the
command line I can now see the file (I emptied the trashcan so it was
empty before I put hello_world.log in there)

....
Directory of C:\RECYCLER\S-1-5-21-*NUMBERS*05

2006-02-13 14:13 2 180 hello_world.log
1 File(s) 2 180 bytes
....

But when I look in the trashcan using the standard GUI I cannot see the
file in there. The trashcan looks as if is empty.

Also, I'd like to be able to restore the files put in the trashcan
(even if I put them there from the command line). Typically a file has
an original location, a date it was removed etc.

Just to illustrate: I created a file "testing_2.txt" and put it in
trash from the regular gui.

Now if I look in the folder from DOS it looks like this:

Directory of C:\RECYCLER\S-1-5-21-*NUMBERS*05

2006-11-22 09:08 0 Dc12466.txt
2006-02-13 14:13 2 180 hello_world.log

Or using Cygwin "ls -lh"
total 9.0K
-rwx------+ 1 per None 0 Nov 22 09:08 Dc12466.txt
-rwx------+ 1 per None 820 Nov 22 09:08 INFO2
-rwx------+ 1 per None 65 Nov 1 11:42 desktop.ini
-rwx------+ 1 per None 2.2K Feb 13 2006 hello_world.log

The file INFO2 seems to contain the info I need to integrate

>type INFO2

♣ u☺ ▒0 ♥ æö♀☺C:\Documents and
Settings\per\Desktop\testing_2.txt

♫╟☺ C : \ D o c u m e n t s a n d S e t t i n g s \ p e r
\ D e s k t o p \ t e s t i n g _ 2 . t x t

My ultimate goal would be a bat-file (f.x. foobar.bat) in my bin-folder
looking something like this:
move /Y %* C:\RECYCLER\S-1-5-21-*NUMBERS*05
That integrates with the regular trashcan. Being able to restore later
is my goal.

Is there perhaps some other exe-file that is run when a user presses
the "delete" button in a regular folder view? and/or generates the info
in INFO2?

Thanks,
Per


Wesley Vogel wrote:
> Move
> Moves one or more files from one directory to the specified directory.
>
> Type in a command prompt: Move /?
>
> More Move HELP.
> Paste the following line into Start | Run and click OK...
>
> hh ntcmds.chm::/move.htm
>
> Each hard disk or partition contains a hidden folder named Recycler. The
> Recycler folder is used only on NTFS partitions. On FAT32 the RECYCLED
> folder is used. The Recycler folder contains a Recycle Bin for each user
> that logs on to the computer, sorted by their security identifier (SID).
>
> My hard drive is formatted NTFS.
>
> This is MY SID #
> S-1-5-21-1708537768-15xx36667-1202660629-1003
>
> This is MY Recycle Bin
> C:\RECYCLER\S-1-5-21-1708537768-15xx36667-1202660629-1003
>
> Your Recycle Bin would be similar, but you need to know your SID #.
>
> This registry key lists all of the SIDs.
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
>
> To tell which user has which SID, click on each SID, look at
> ProfileImagePath, the Data has the user name at the end of the path. I.e.
> %SystemDrive%\Documents and Settings\Wesley P. Vogel
>
> --
> Hope this helps. Let us know.
>
> Wes
> MS-MVP Windows Shell/User
>
> In news:(E-Mail Removed),
> per9000 <(E-Mail Removed)> hunted and pecked:
> > Hi all,
> >
> > I work a lot in windows from the command line. I'd like to be able to,
> > instead of only deleting a file (f.x. "del *.tmp") be able to move it
> > to the trashcan.
> >
> > I could just move to C:\MyTrashCan, but I'd like it to be able to
> > browse, and preferably replace files later with the standard trash can
> > view.
> >
> > Thanks,
> > Per


 
Reply With Quote
 
Ayush
Guest
Posts: n/a
 
      22nd Nov 2006
The file is renamed + the info is generated in InFO2 file.
http://support.microsoft.com/kb/136517

--
Ayush [ Be ''?'' Happy ]
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------


Replid to [per9000]s message :
-----------------------------------------------------------
> Hi Wesley,
>
> yes, indeed this seems to move files to the trashcan-folder. From the
> command line I can now see the file (I emptied the trashcan so it was
> empty before I put hello_world.log in there)
>
> ...
> Directory of C:\RECYCLER\S-1-5-21-*NUMBERS*05
>
> 2006-02-13 14:13 2 180 hello_world.log
> 1 File(s) 2 180 bytes
> ...
>
> But when I look in the trashcan using the standard GUI I cannot see
> the file in there. The trashcan looks as if is empty.
>
> Also, I'd like to be able to restore the files put in the trashcan
> (even if I put them there from the command line). Typically a file has
> an original location, a date it was removed etc.
>
> Just to illustrate: I created a file "testing_2.txt" and put it in
> trash from the regular gui.
>
> Now if I look in the folder from DOS it looks like this:
>
> Directory of C:\RECYCLER\S-1-5-21-*NUMBERS*05
>
> 2006-11-22 09:08 0 Dc12466.txt
> 2006-02-13 14:13 2 180 hello_world.log
>
> Or using Cygwin "ls -lh"
> total 9.0K
> -rwx------+ 1 per None 0 Nov 22 09:08 Dc12466.txt
> -rwx------+ 1 per None 820 Nov 22 09:08 INFO2
> -rwx------+ 1 per None 65 Nov 1 11:42 desktop.ini
> -rwx------+ 1 per None 2.2K Feb 13 2006 hello_world.log
>
> The file INFO2 seems to contain the info I need to integrate
>
>> type INFO2

> ? u? ?0 ? æö??C:\Documents and
> Settings\per\Desktop\testing_2.txt
>
> ??? C : \ D o c u m e n t s a n d S e t t i n g s \ p e r
> \ D e s k t o p \ t e s t i n g _ 2 . t x t
>
> My ultimate goal would be a bat-file (f.x. foobar.bat) in my
> bin-folder looking something like this:
> move /Y %* C:\RECYCLER\S-1-5-21-*NUMBERS*05
> That integrates with the regular trashcan. Being able to restore later
> is my goal.
>
> Is there perhaps some other exe-file that is run when a user presses
> the "delete" button in a regular folder view? and/or generates the
> info in INFO2?
>
> Thanks,
> Per
>
>
> Wesley Vogel wrote:
>> Move
>> Moves one or more files from one directory to the specified
>> directory.
>>
>> Type in a command prompt: Move /?
>>
>> More Move HELP.
>> Paste the following line into Start | Run and click OK...
>>
>> hh ntcmds.chm::/move.htm
>>
>> Each hard disk or partition contains a hidden folder named Recycler.
>> The Recycler folder is used only on NTFS partitions. On FAT32 the
>> RECYCLED folder is used. The Recycler folder contains a Recycle Bin
>> for each user that logs on to the computer, sorted by their security
>> identifier (SID).
>>
>> My hard drive is formatted NTFS.
>>
>> This is MY SID #
>> S-1-5-21-1708537768-15xx36667-1202660629-1003
>>
>> This is MY Recycle Bin
>> C:\RECYCLER\S-1-5-21-1708537768-15xx36667-1202660629-1003
>>
>> Your Recycle Bin would be similar, but you need to know your SID #.
>>
>> This registry key lists all of the SIDs.
>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>> NT\CurrentVersion\ProfileList
>>
>> To tell which user has which SID, click on each SID, look at
>> ProfileImagePath, the Data has the user name at the end of the path.
>> I.e. %SystemDrive%\Documents and Settings\Wesley P. Vogel
>>
>> --
>> Hope this helps. Let us know.
>>
>> Wes
>> MS-MVP Windows Shell/User
>>
>> In news:(E-Mail Removed),
>> per9000 <(E-Mail Removed)> hunted and pecked:
>>> Hi all,
>>>
>>> I work a lot in windows from the command line. I'd like to be able
>>> to, instead of only deleting a file (f.x. "del *.tmp") be able to
>>> move it to the trashcan.
>>>
>>> I could just move to C:\MyTrashCan, but I'd like it to be able to
>>> browse, and preferably replace files later with the standard trash
>>> can view.
>>>
>>> Thanks,
>>> Per



 
Reply With Quote
 
Wesley Vogel
Guest
Posts: n/a
 
      22nd Nov 2006
Hi Per,

When you delete a file, the complete path and file name is stored in a
hidden file called Info2 in the Recycler folder.

for example, Dc12466.txt

D means Deleted.
c means the dile was deleted from the C: drive.
12466 means it was the 12466th deleted file.
txt means it was a text file, probably testing_2.txt

I wonder why the high number, 12466? INFO2 messed up?

If I paste this into the Run command (Start | Run ) and click OK
C:\RECYCLER\S-1-5-21-1708537768-1580436667-1202660629-1003\info2
the Open With applet comes up.
Select Notepad and click OK or just double click on Notepad from the list.
INFO2 opens.

Or you can do this in a command prompt...

start C:\RECYCLER\S-1-5-21-1708537768-1580436667-1202660629-1003\info2

the Open With applet comes up.
Select Notepad and click OK or just double click on Notepad from the list.
INFO2 opens.

This what's in my INFO2...
C:\Documents and Settings\Wesley P. Vogel\Desktop\278startmenupin.reg

C : \ D o c u m e n t s a n d S e t t i n g s \ W e s l e y P . V o
g e l \ D e s k t o p \ 2 7 8 s t a r t m e n u p i n . r e g

C:\Documents and Settings\Wesley P. Vogel\Desktop\startmenupin.reg

C : \ D o c u m e n t s a n d S e t t i n g s \ W e s l e y P . V o
g e l \ D e s k t o p \ s t a r t m e n u p i n . r e g

C:\Documents and Settings\Wesley P. Vogel\Desktop\pinlistenable.reg

C : \ D o c u m e n t s a n d S e t t i n g s \ W e s l e y P . V o
g e l \ D e s k t o p \ p i n l i s t e n a b l e . r e g

C:\Documents and Settings\Wesley P. Vogel\Desktop\New Text Document.txt

C : \ D o c u m e n t s a n d S e t t i n g s \ W e s l e y P . V o
g e l \ D e s k t o p \ N e w T e x t D o c u m e n t . t x t
------------

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\>cd C:\RECYCLER\S-1-5-21-1708537768-1580436667-1202660629-1003

C:\RECYCLER\S-1-5-21-1708537768-1580436667-1202660629-1003>dir
Volume in drive C is Local Disk
Volume Serial Number is 901E-9F82

Directory of C:\RECYCLER\S-1-5-21-1708537768-1580436667-1202660629-1003

22-Nov-06 10:46 AM 1,454 Dc1.reg
22-Nov-06 10:43 AM 1,454 Dc2.reg
22-Nov-06 10:45 AM 161 Dc3.reg
22-Nov-06 11:42 AM 0 Dc4.txt
4 File(s) 3,069 bytes
0 Dir(s) 2,128,506,880 bytes free

C:\RECYCLER\S-1-5-21-1708537768-1580436667-1202660629-1003>
--------------

You can see how Dc1.reg, Dc2.reg, Dc3.reg and Dc4.txt relate to
278startmenupin.reg, startmenupin.reg, pinlistenable.reg and New Text
Document.txt.

> Also, I'd like to be able to restore the files put in the trashcan
> (even if I put them there from the command line).


Would probably be some sort of a Shell function or call. I have no idea
which one and am not going to go look. Most of that stuff is over my head.

> But when I look in the trashcan using the standard GUI I cannot see the
> file in there. The trashcan looks as if is empty.


[[No files may appear in the Recycle Bin if the files in the Recycled folder
are damaged.]]

Run chkdsk. Reboot. Look at the Recycle Bin again.

INFO2 can become corrupted and if it cannot be fixed it needs to be deleted.

Cannot Delete Any Files in Windows
http://support.microsoft.com/kb/246726

How the Recycle Bin Stores Files
http://support.microsoft.com/kb/136517

> Is there perhaps some other exe-file that is run when a user presses
> the "delete" button in a regular folder view? and/or generates the info
> in INFO2?


My silly wild a** guess would be explorer.exe and shell32.dll.

I just found this one, looks interesting haven't read it yet.

Forensic Analysis of Microsoft Windows Recycle Bin Records
http://www.e-fense.com/helix/Docs/Re...nstruction.pdf
or view as html
http://72.14.253.104/search?q=cache:...s&ct=clnk&cd=2


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:(E-Mail Removed),
per9000 <(E-Mail Removed)> hunted and pecked:
> Hi Wesley,
>
> yes, indeed this seems to move files to the trashcan-folder. From the
> command line I can now see the file (I emptied the trashcan so it was
> empty before I put hello_world.log in there)
>
> ...
> Directory of C:\RECYCLER\S-1-5-21-*NUMBERS*05
>
> 2006-02-13 14:13 2 180 hello_world.log
> 1 File(s) 2 180 bytes
> ...
>
> But when I look in the trashcan using the standard GUI I cannot see the
> file in there. The trashcan looks as if is empty.
>
> Also, I'd like to be able to restore the files put in the trashcan
> (even if I put them there from the command line). Typically a file has
> an original location, a date it was removed etc.
>
> Just to illustrate: I created a file "testing_2.txt" and put it in
> trash from the regular gui.
>
> Now if I look in the folder from DOS it looks like this:
>
> Directory of C:\RECYCLER\S-1-5-21-*NUMBERS*05
>
> 2006-11-22 09:08 0 Dc12466.txt
> 2006-02-13 14:13 2 180 hello_world.log
>
> Or using Cygwin "ls -lh"
> total 9.0K
> -rwx------+ 1 per None 0 Nov 22 09:08 Dc12466.txt
> -rwx------+ 1 per None 820 Nov 22 09:08 INFO2
> -rwx------+ 1 per None 65 Nov 1 11:42 desktop.ini
> -rwx------+ 1 per None 2.2K Feb 13 2006 hello_world.log
>
> The file INFO2 seems to contain the info I need to integrate
>
>> type INFO2

> ♣ u☺ ▒0 ♥ æö♀☺C:\Documents and
> Settings\per\Desktop\testing_2.txt
>
> ♫╟☺ C : \ D o c u m e n t s a n d S e t t i n g s \ p e r
> \ D e s k t o p \ t e s t i n g _ 2 . t x t
>
> My ultimate goal would be a bat-file (f.x. foobar.bat) in my bin-folder
> looking something like this:
> move /Y %* C:\RECYCLER\S-1-5-21-*NUMBERS*05
> That integrates with the regular trashcan. Being able to restore later
> is my goal.
>
> Is there perhaps some other exe-file that is run when a user presses
> the "delete" button in a regular folder view? and/or generates the info
> in INFO2?
>
> Thanks,
> Per
>
>
> Wesley Vogel wrote:
>> Move
>> Moves one or more files from one directory to the specified directory.
>>
>> Type in a command prompt: Move /?
>>
>> More Move HELP.
>> Paste the following line into Start | Run and click OK...
>>
>> hh ntcmds.chm::/move.htm
>>
>> Each hard disk or partition contains a hidden folder named Recycler. The
>> Recycler folder is used only on NTFS partitions. On FAT32 the RECYCLED
>> folder is used. The Recycler folder contains a Recycle Bin for each user
>> that logs on to the computer, sorted by their security identifier (SID).
>>
>> My hard drive is formatted NTFS.
>>
>> This is MY SID #
>> S-1-5-21-1708537768-15xx36667-1202660629-1003
>>
>> This is MY Recycle Bin
>> C:\RECYCLER\S-1-5-21-1708537768-15xx36667-1202660629-1003
>>
>> Your Recycle Bin would be similar, but you need to know your SID #.
>>
>> This registry key lists all of the SIDs.
>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
>> NT\CurrentVersion\ProfileList
>>
>> To tell which user has which SID, click on each SID, look at
>> ProfileImagePath, the Data has the user name at the end of the path.
>> I.e. %SystemDrive%\Documents and Settings\Wesley P. Vogel
>>
>> --
>> Hope this helps. Let us know.
>>
>> Wes
>> MS-MVP Windows Shell/User
>>
>> In news:(E-Mail Removed),
>> per9000 <(E-Mail Removed)> hunted and pecked:
>>> Hi all,
>>>
>>> I work a lot in windows from the command line. I'd like to be able to,
>>> instead of only deleting a file (f.x. "del *.tmp") be able to move it
>>> to the trashcan.
>>>
>>> I could just move to C:\MyTrashCan, but I'd like it to be able to
>>> browse, and preferably replace files later with the standard trash can
>>> view.
>>>
>>> Thanks,
>>> Per


 
Reply With Quote
 
per9000
Guest
Posts: n/a
 
      23rd Nov 2006
Hi Wesley,


> When you delete a file, the complete path and file name is stored in a
> hidden file called Info2 in the Recycler folder.


Ok, I suspected something like that.


> I wonder why the high number, 12466? INFO2 messed up?


I create tons of log files at work (most of which I just delete - these
are the ones I'd like to put in the trash instead of hard-killing
them). Probably that's why I have the large number.

I'll try to avoid hacking INFO2 - but I am tempted


> > Also, I'd like to be able to restore the files put in the trashcan
> > (even if I put them there from the command line).

>
> Would probably be some sort of a Shell function or call. I have no idea
> which one and am not going to go look. Most of that stuff is over my head.


Ok, that's too bad - I was hoping for some way to '"press the delete
button in the gui" from the console'.


> > But when I look in the trashcan using the standard GUI I cannot see the
> > file in there. The trashcan looks as if is empty.

>
> [[No files may appear in the Recycle Bin if the files in the Recycled folder
> are damaged.]]
>


This was probably an artifact from
move /Y *.* C:\RECYCLER\*numbers*

I put a file in there from the console - I could not see the file from
the trashcan view. Probably because there was no info of it in INFO2. I
removed the file from the console and now the trashcan seems healthy.


> Forensic Analysis of Microsoft Windows Recycle Bin Records
> http://www.e-fense.com/helix/Docs/Re...nstruction.pdf


Seems interesting - but I don't want to risk a trash-can-crash by
hacking INFO2. I was looking for some exe/dll-file to call to do the
dirty work for me.


> Hope this helps. Let us know.


Well, it didn't solve my "problem" but it explained a lot. Thanks.

/Per

 
Reply With Quote
 
Wesley Vogel
Guest
Posts: n/a
 
      23rd Nov 2006
Howdy Per,

> Ok, that's too bad - I was hoping for some way to '"press the delete
> button in the gui" from the console'.


I believe that the del command is the same as hitting Shift + Delete on the
keyboard.

Warning
After you delete a file from your disk using del, you cannot retrieve it.

Type in Start | Run
hh ntcmds.chm::/del.htm

SHIFT+DELETE
Delete selected item permanently without placing the item in the Recycle
Bin.

To permanently delete a file, press and hold down SHIFT and drag it to the
Recycle Bin. The item is permanently deleted and cannot be retrieved from
the Recycle Bin.

> This was probably an artifact from
> move /Y *.* C:\RECYCLER\*numbers*
>
> I put a file in there from the console - I could not see the file from
> the trashcan view. Probably because there was no info of it in INFO2. I
> removed the file from the console and now the trashcan seems healthy.


That would explain it.

You ought to buy a mouse. That right click is the latest thing. ;-)

You might use a VBS script, see...
To delete a text file and send it to the Recycle Bin
here...
How to: Delete a File in Visual Basic
http://msdn2.microsoft.com/en-gb/library/tdx72k4b(VS.80).aspx

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:(E-Mail Removed),
per9000 <(E-Mail Removed)> hunted and pecked:
> Hi Wesley,
>
>
>> When you delete a file, the complete path and file name is stored in a
>> hidden file called Info2 in the Recycler folder.

>
> Ok, I suspected something like that.
>
>
>> I wonder why the high number, 12466? INFO2 messed up?

>
> I create tons of log files at work (most of which I just delete - these
> are the ones I'd like to put in the trash instead of hard-killing
> them). Probably that's why I have the large number.
>
> I'll try to avoid hacking INFO2 - but I am tempted
>
>
>>> Also, I'd like to be able to restore the files put in the trashcan
>>> (even if I put them there from the command line).

>>
>> Would probably be some sort of a Shell function or call. I have no idea
>> which one and am not going to go look. Most of that stuff is over my
>> head.

>
> Ok, that's too bad - I was hoping for some way to '"press the delete
> button in the gui" from the console'.
>
>
>>> But when I look in the trashcan using the standard GUI I cannot see the
>>> file in there. The trashcan looks as if is empty.

>>
>> [[No files may appear in the Recycle Bin if the files in the Recycled
>> folder are damaged.]]
>>

>
> This was probably an artifact from
> move /Y *.* C:\RECYCLER\*numbers*
>
> I put a file in there from the console - I could not see the file from
> the trashcan view. Probably because there was no info of it in INFO2. I
> removed the file from the console and now the trashcan seems healthy.
>
>
>> Forensic Analysis of Microsoft Windows Recycle Bin Records
>> http://www.e-fense.com/helix/Docs/Re...nstruction.pdf

>
> Seems interesting - but I don't want to risk a trash-can-crash by
> hacking INFO2. I was looking for some exe/dll-file to call to do the
> dirty work for me.
>
>
>> Hope this helps. Let us know.

>
> Well, it didn't solve my "problem" but it explained a lot. Thanks.
>
> /Per


 
Reply With Quote
 
per9000
Guest
Posts: n/a
 
      24th Nov 2006
Hi.

Wesley Vogel wrote:
> You ought to buy a mouse. That right click is the latest thing. ;-)


Mouse schmouse, me like qwerty :-D


>
> You might use a VBS script, see...
> To delete a text file and send it to the Recycle Bin
> here...
> How to: Delete a File in Visual Basic
> http://msdn2.microsoft.com/en-gb/library/tdx72k4b(VS.80).aspx
>
> --
> Hope this helps. Let us know.


Yes, that could be perfect (I always needed an excuse to learn Visual
Basic (but I would have thought I'd learn VB.NET before VBS)) so this
could be really excellent.

The key seems to be (in VB.NET):
My.Computer.FileSystem.DeleteFile("C:\test.txt", _
FileIO.UIOption.AllDialogs, FileIO.RecycleOption.SendToRecycleBin)

I'll try it out and tell you what happens - unless I make a bad loop...

Thanks,
Per

 
Reply With Quote
 
Wesley Vogel
Guest
Posts: n/a
 
      24th Nov 2006
Hi Per,

> Mouse schmouse, me like qwerty :-D


At least not Dvorak.

> The key seems to be (in VB.NET):


I'd use VB, you already have cscript.exe and wscript.exe on your machine. I
have even done a *little* vbs scripting. Use a vbs extension.

For example, this will open the Run command

-------FileRun.vbs---------
Dim objShell
set objShell = CreateObject("Shell.Application")
objShell.FileRun
-------FileRun.vbs---------

You can drag .vbs files into the command prompt to run them. I know, the
schmouse deal.


cscript /?

wscript /?

---------------------------
Windows Script Host
---------------------------
Usage: WScript scriptname.extension [option...] [arguments...]

Options:
//B Batch mode: Suppresses script errors and prompts from displaying
//D Enable Active Debugging
//E:engine Use engine for executing script
//H:CScript Changes the default script host to CScript.exe
//H:WScript Changes the default script host to WScript.exe (default)
//I Interactive mode (default, opposite of //B)
//Job:xxxx Execute a WSF job
//Logo Display logo (default)
//Nologo Prevent logo display: No banner will be shown at execution time
//S Save current command line options for this user
//T:nn Time out in seconds: Maximum time a script is permitted to run
//X Execute script in debugger
---------------------------
OK
---------------------------

Windows Scripting Guide
http://www.winguides.com/scripting/

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:(E-Mail Removed),
per9000 <(E-Mail Removed)> hunted and pecked:
> Hi.
>
> Wesley Vogel wrote:
>> You ought to buy a mouse. That right click is the latest thing. ;-)

>
> Mouse schmouse, me like qwerty :-D
>
>
>>
>> You might use a VBS script, see...
>> To delete a text file and send it to the Recycle Bin
>> here...
>> How to: Delete a File in Visual Basic
>> http://msdn2.microsoft.com/en-gb/library/tdx72k4b(VS.80).aspx
>>
>> --
>> Hope this helps. Let us know.

>
> Yes, that could be perfect (I always needed an excuse to learn Visual
> Basic (but I would have thought I'd learn VB.NET before VBS)) so this
> could be really excellent.
>
> The key seems to be (in VB.NET):
> My.Computer.FileSystem.DeleteFile("C:\test.txt", _
> FileIO.UIOption.AllDialogs, FileIO.RecycleOption.SendToRecycleBin)
>
> I'll try it out and tell you what happens - unless I make a bad loop...
>
> Thanks,
> Per


 
Reply With Quote
 
per9000
Guest
Posts: n/a
 
      27th Nov 2006
Hi,

since I still need (sooner or later) to use Visual Basic .NET (we will
soon launch a product in .NET so we need to support users using Visual
Basic (and all the other .NET languages)) I installed MS Visual Basic
2005 Express Edition (big thank you to MS for the MSV*2005EE-series, I
have installed C++, C# and now the VB version) and did my first little
VB'ing.

At first I got a popup asking me if I really wanted to move the file to
trash, but using FileIO.UIOption.OnlyErrorDialogs instead of the option
in a previous message did the trick.

----------------
Imports System
Module Module1
Sub Main()
Console.WriteLine("Hello VB.NET World!")
My.Computer.FileSystem.DeleteFile("C:\temp\time.txt",
FileIO.UIOption.OnlyErrorDialogs,
FileIO.RecycleOption.SendToRecycleBin)
End Sub
End Module
----------------

Now I only have to learn to import arguments from the console to VB and
incorporate wildcards (f.x "trashem prefix*suffix.log") - should not be
to hard if I want to finish this.

So it's "problem solved" (all that remains are some details) and again:
Thanks.

/Per

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007: IMAP - "Delete" vs "Move to Trash" 1001001100100 Microsoft Outlook 2 12th Apr 2007 04:41 AM
after a ftp put command it just says "200 PORT command successful." and hangs forever. What could be wrong? when i test the ftp server using IE in "passive" mode it works fine. but ftp at command line hangs on "200 PORT comma Daniel Microsoft Windows 2000 Security 6 1st May 2006 02:51 PM
after a ftp put command it just says "200 PORT command successful." and hangs forever. What could be wrong? when i test the ftp server using IE in "passive" mode it works fine. but ftp at command line hangs on "200 PORT comma Daniel Microsoft Windows 2000 Networking 1 29th Apr 2006 02:42 AM
after a ftp put command it just says "200 PORT command successful." and hangs forever. What could be wrong? when i test the ftp server using IE in "passive" mode it works fine. but ftp at command line hangs on "200 PORT comma Daniel Microsoft Windows 2000 1 29th Apr 2006 02:05 AM
Can not rename or delete folders "graphically" (command line is OK =?Utf-8?B?TWljaGFlbA==?= Windows XP Security 0 6th Feb 2005 07:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:33 PM.