O comanda simpla de PowerShell prin care verificam daca exista un fisier anume, apoi il stergem.

1. Deschideti PowerShell:

a) Start -> Programs -> Accesories -> Windows PowerShell

sau

b) Start -> Search Programs and Files -> Scrieti “PowerShell” -> Enter

2. Copiati comenzile de mai jos.


$NumeFisier = "C:\fisier_test.txt"
IF (Test-Path $NumeFisier){
Remove-Item $NumeFisier
}

1 Comment
  1. Romana 11 years ago

    Toate bune dar liniile 2, 3 si 4 trebuie sa fie de fapt una singura ca sa functioneze. Adica asa: IF (Test-Path $NumeFisier){ Remove-Item $NumeFisier }
    Cel putin doar asa mi-a mers mie.

Leave a reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

©2024 KLEO Template a premium and multipurpose theme from Seventh Queen

Log in with your credentials

Forgot your details?