move files from a specific folder to recycle bin

Welcome Forums General PowerShell Q&A move files from a specific folder to recycle bin

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
2 years ago.

  • Author
    Posts
  • #60183

    Participant
    Points: 4
    Rank: Member

    Dear people,

    I need to create a logoff script that moves all data from a specific folder to recyclebin.

    this is what i have so far:

    $sh = new-object -comobject "Shell.Application"
    $ns = $sh.Namespace(0).ParseName("C:\test\*")
    $ns.InvokeVerb("delete")
    

    I hope someone can help me

    Kind regards, Jeremy Smit

  • #60199

    Participant
    Points: 350
    Helping Hand
    Rank: Contributor

    What is or is not working?

The topic ‘move files from a specific folder to recycle bin’ is closed to new replies.