Filehost.ro - gazduire fisiere
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
simpacurly69 pe Simpatie.ro
Femeie
24 ani
Bucuresti
cauta Barbat
35 - 70 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[CMD] Replace Text In All VBS Files in Current Folder

Pagini: 1 Moderat de TRaP, TonyTzu
pus acum 2 luni#1
TRaP
Moderator
Postari: 960
Open Command Prompt in the desired folder and use one of the following commands to replace text.

1. Replace all occurrences of year 2025 with year 2026 (in my case both are stored as text, like this "2025" and "2026")

for %f in (*.vbs) do (powershell -Command "(Get-Content '%f') -replace '2025','2026' | Set-Content '%f'")

Source: ChatGPT

2. Replace only the first occurrence of the text (in my case these are stored as text, and each appear multiple times in the VBS files)

for %f in (*.vbs) do (powershell -Command "$c = Get-Content '%f' -Raw; $re = [regex]'1000'; $re.Replace($c, '5000', 1) | Set-Content '%f'")

Source: Gemini


 
   
Pagini: 1  
Mergi la