LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic file deleting by shifting to XP wastebasket/tray/recycled directory

Solved!
Go to solution

Hi,

I am looking for a VI that allows deleting of files by putting the file to the XP wastebasket (or "tray", "recycled directory"), as usual when I delete filers under XP regularly.

Using the built-in LabView routine "DELETE" from the File I/O directory deletes files completely, i.e. without shifting them to the tray.

Thanks,

Hansjoerg

0 Kudos
Message 1 of 12
(2,948 Views)

Hi hansjoerg,

move the files to the sub folder in the Recycler folder in your c: directoy.

 

Mike

0 Kudos
Message 2 of 12
(2,937 Views)
There are several sub-folder, and I cannot open them.
So how can I adress the right path to the wastebasket?
0 Kudos
Message 3 of 12
(2,922 Views)

Hi Hansjoerg,

i´m not sure if there is another solution, but you can read the it in the registry. Use following key: HKEY_Local_Machin\Software\Microsoft\Windows NT\CurrentVersion\ProfileList and read in all folders the key "ProfileImagePath". If this path has the login name at the end, then you have found the correct subfolder in the Recycler.

 

Hope it helps.

Mike

Message 4 of 12
(2,914 Views)

Hi Mike,

first thanks for your excellent help!

Thats nearly all the information I needed, except that I also would like to programatically access the login name...

Do you know the registry key for that?

 

(BTW I wonder why LV still does not have more elaborate "file delete" functions implemented...)

0 Kudos
Message 5 of 12
(2,903 Views)

Hi Hanjoerg,

you can use a property node to read this information. See the attached file.

 

Hope it helps.

Mike

0 Kudos
Message 6 of 12
(2,882 Views)

Hi Mike,

 

I now have  implemented a LabView routine that does exactly what you suggested:
It analyses the key"HKEY_Local_Machin\Software\Microsoft\Windows NT\CurrentVersion\ProfileList", reads the keys "ProfileImagePath", and identifies the Path corresponding to the key value with the login name at the end. This identifies the recycler subfolder C:\recycler\.... .

 

But when I use the Labview "Move" function and shift a file to this directory (I have also tried "D:\recycler\...."), it doesnt neither appear in the XP explorer nor when I click on the wastebasket desktop icon. I only see it (in the correct tray folder) with tools like Windows Commander or so.

 

Any further hints?

Thanks again,

Hansjoerg

 

0 Kudos
Message 7 of 12
(2,864 Views)

Hi Hansjoreg,

sorry for this. I tried it with drag and drop a file into this folder and this works, so i thought it should also work with automatically move it. Please see this search results http://forums.ni.com/ni/search?board_id=170&submitted=true&q=SHFileOperation they should help you.

 

Mike

Message 8 of 12
(2,855 Views)

Hi Hansjoerg,

have you found a solution now?

 

Try to help.

Mike

0 Kudos
Message 9 of 12
(2,814 Views)

Hi Mike,

thanks for caring.
No, I have given up somehow cause to me there seems to be no easy way to do what I want. In my understanding now and with my limited capabilities in LabView, after reading in the threads you suggested me it seem that the use of the XP tray needs at least some toolboxes or so that I dont have access to. So I am going for another solution, like creating my own tray dir with Labview and shift deleted files to there. That is a resonable compromise for my purpose.

But thanks again for all your hints!
Hansjörg

0 Kudos
Message 10 of 12
(2,811 Views)