PDA

View Full Version : Shellnut


||Console||
05-03-07, 02:28 PM
Did you write that bat file to chaneg the user names for me yet =)

pik4chu
05-03-07, 02:38 PM
:confused:

Shelnutt2
05-03-07, 02:43 PM
uhm, uhm.



Give me one sec..




edit:
http://www.bestcode.com/html/findreplace.html

you need to download that, and have it in the same dir as the bat file below.

replace -srcdir pathoffahfolder -find oldusername -replace newusername -fname client.cfg

pathoffahfolder should be like C:\FAH\




if you can't download the replace.exe program, then I will have to use VBscript to write it, I don't mind but I was just trying to save the hassle of vbscript, as sometimes it can be funky.

Shelnutt2
05-03-07, 03:29 PM
blah! Here you go.

VBS Script

Set fso=CreateObject("Scripting.FileSystemObject")
r="pathtofahfolder\client.cfg"
if fso.FileExists(r)=false then
wscript.Quit
end if
set f=fso.OpenTextFile(r,1)
s=f.ReadAll
n=replace(s,"oldusername","newusername",1,-1,0)
set f=fso.OpenTextFile(r,2)
f.Write n
f.Close

||Console||
05-03-07, 03:39 PM
I know nothing about programing ? how to I compile it ?

Shelnutt2
05-03-07, 03:54 PM
I know nothing about programing ? how to I compile it ?


oops...forgot that part. For the VB script, copy it to a file, but the extension must be .vbs. So you could be like changename.vbs. Or simple chname.vbs . Then run it, by either right clicking and run, or open a command prompt and cd to the directory and then "filename.vbs" and it will run the script. No compiling required.

use the vbs script it works, and is easy..but don't forgot to put in the oldusername, newusername and path of the fah foler/client.cfg file. I have it bolded/italicised where you need to put those in, directly in the code.

||Console||
05-03-07, 03:57 PM
Sweet thx will start moving my boxs over tomorrow morring =)