Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function doit {
  2.     Get-Content -path "C:\xy.bat" | Out-File "C:\new.txt" -Force
  3.     $bat_n = "C:\new.txt"
  4.     $bat_f = New-Item "C:\new.bat" -Force
  5.     $userid = $txtbox_userid.Text
  6.     $ticketname = $txtbox_ticketname.Text
  7.     $time = $txtbox_time.Text
  8.     (Get-Content $bat_n) | Foreach-Object {
  9.         $_ -replace 'xy', "$userid" `
  10.             -replace 'update', "$ticketname" `
  11.             -replace '"7","00"', '"8","00"' `
  12.     } | Set-Content $bat_f
  13. }
  14.  
  15. [void]$global:form_main.ShowDialog()
  16. $btn_doit.Add_Click( { doit })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement