Đổi tên file bằng lệnh Powershell

Theo: nguyenhaidang.name.vn | 08/10/2020 - 11:16

 Lệnh như sau


$files = Get-ChildItem -Path D:\DU_AN\CHECK-IN\2020\VIETLINK\VietLink_681-740\VietLink_681-740\
foreach ($file in $files) 
{
  #$file.Name.Replace("THU-MOI-ONLINE","---" )
  #$newFileName
  #$file.Name
  #$file.Name
  $dd="D:\DU_AN\CHECK-IN\2020\VIETLINK\VietLink_681-740\VietLink_681-740\"+$file.Name
  Rename-Item -Path $dd -NewName $file.Name.Replace("THU-MOI-ONLINE-21g45_MÃ KHÁCH HÀNG-  KC001_MÃ KHÁCH HÀNG-   ","")
  #$file.Name
 
}

Back Head Print
Tin khác

Search GridView with Paging on TextBox KeyPress using jQuery in ASP.Net    (28/07/2010)

Bootstrap AutoComplete TextBox example using jQuery TypeAhead plugin in ASP.Net with C# and VB.Net    (28/07/2010)

Disable Button and Submit button after one click using JavaScript and jQuery    (29/07/2010)

Split and convert Comma Separated (Delimited) String to Table in SQL Server    (01/09/2010)

Select Column values as Comma Separated (Delimited) string in SQL Server using COALESCE    (01/09/2010)