/build/static/layout/Breadcrumb_cap_w.png

Need help using a script to modify an INI file

hello all-

I need your help with this script I am trying to write . I have this file located in the windows dir on a couple workstations I just need to modify one line in that file. I figure a script should be able to modify right here is the file. then do a push using kace

 

  

[Globals] 

Bank=812 

Branch=001 

ExePath=\\Enet-03\Teller Train\ExePath 

ShrPath=\\Enet-03\Teller Train\ShrPath 

alphaFldUpperCase=YES 

hostName=192.168.5.151 

portNumber=27201 

DisplayPrintInDemo=NO 

DeviceTable=SPECTRUM 

AutoDownLoad=NO 

  

[Teller] 

autoInquiry=Yes 

CTRAdviseMsg=yes 

ctrLimit1=3000.01 

ctrLimit2=10000.01 

CheckBatching=YES 

ChecksPerfSkipLines=3 

CUNameOnCheck=NO 

InquiryFontName=Lucida Console 

InquiryFontSize=8 

HoldCodeOption=OPTIONAL 

NoDecimal=YES 

AutoCashCount=YES 

AutoCashOutCount=YES 

AutoBillMix=1,2,3,2,2,0,1 

AvailableCoin=N,N,Y,Y,Y,Y 

AutoChkCalc=YES 

TroyLJPrinter=NO 

RepeatTranEnabled=NO 

ForcePostForward=YES 

CashCountTotalReq=NO 

CashCountFocus=100 

  

[ApplicationSetup] 

GUISpectrum= 

AccountHolderProfileSupport=NO 

LenderAdvantageSupport=NO 

LenderAdvantagePathName= 

BranchSuiteSupport=NO 

WebServicesURL=http://YourHost/ASTellerUI/services/VB6Service?wsdl 

ReturnToBRanch=NO 

IMMChkScan=NO 

Next=NO 

  

[ImageManSystem] 

DocManSupport=NO 

ArcHostName=YourHost 

ArcPortNumber=5671 

Autoarchive=NO 

AutoSigCapture=NO 

SigTransfers=NO 

SigCashOut=NO 

SigCheckWD=NO 

SigChkCashing=NO 

SigWithdrawal=NO 

SigFTCodes= 

SigWindow=YES 

DocManSignatureCaptureURL=http://YourHost/TrueImageTellerUI/Signature/SigCapture.jsp 

DocManPathName=http://YourHost/shared 

IDViewerSupport=NO 

IDViewerPathName=http://YourHost/ASTellerUI/memberid 

  

[CashDispenser] 

CoinDispenser=NO 

CashOutDisplay=NO 

  

[Security] 

HostUpRetry=5 

JournalRetentionDays=15 this is the line I need to modify 

PasswordAttempts=3 

UpdateHosts=none 

  

[NarrowReceipts] 

CFReceipts=NO 

CFPrinter= 

CFFontSize=8 

CFFont=Lucida Console 

  

[LocalPrinter] 

LocalPrint=NO 

LPPrinter=\\enet-01\Xerox Phaser 4500N-Train 

LPFont=Lucida Console 

LPFontSize=10  

 

 

 

Please let me know!

 

 

 

Thanks

 

 

 

Alex

 

 


0 Comments   [ + ] Show comments

Answers (6)

Answer Summary:
Posted by: brighstarcuit 11 years ago
7th Degree Black Belt
1

how can i push a vbs script through kace


Comments:
  • http://www.itninja.com/question/kace-k1000-how-do-you-run-a-vbscript-file - dugullett 11 years ago
  • thanks beat me to that one. - SMal.tmcc 11 years ago
Posted by: brighstarcuit 11 years ago
7th Degree Black Belt
0

this is what i have so far ' This script opens up an ini file and changes
' the JournalRetentionDays= string from 5 to 15.
 
Const ForReading = 1
Const ForWriting = 2
 
fileToChange = "C:\windows\specwin.ini"
 
set fso = CreateObject("Scripting.FileSystemObject")
 
set oFile = fso.OpenTextFile(iniFile, ForReading)
sText = oFile.ReadAll
oFile.Close
 
sNewText = Replace(sText, "JournalRetentionDays=5", "JournalRetentionDays=15")
 
set oFile = fso.OpenTextFile(fileToChange, ForWriting)
oFile.WriteLine sNewText
oFile.close
 


Comments:
  • here is a link for vbscript, you look good so far
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/02/08/how-can-i-find-and-replace-text-in-a-text-file.aspx - SMal.tmcc 11 years ago
  • create an application and upload your script, use cscript.exe as the app and list the script as a dependancy - SMal.tmcc 11 years ago
Posted by: SMal.tmcc 11 years ago
Red Belt
0

I believe in power shell

Get-Content C:\windows\specwin.ini | ForEach-Object { $_ -replace "JournalRetentionDays=5", "JournalRetentionDays=15" } | Set-Content C:\windows\specwin.ini


Comments:
  • thanks i got it to work now how can i push it using kace - brighstarcuit 11 years ago
  • powershell.exe -nologo -executionpolicy bypass -WindowStyle hidden -noprofile -file "script.ps1"
    cscript your.vbs if your are using the vb script you created - SMal.tmcc 11 years ago
  • i am gonna use the script i created do i need to upload the script in the distribution or go to the scripting tab this is my first time doing a push in kace using a vbs script - brighstarcuit 11 years ago
  • create an application and upload your script, use cscript.exe as the app and list the script as a dependancy - SMal.tmcc 11 years ago
Posted by: jagadeish 11 years ago
Red Belt
0

This can be done using VBScript/Wise Script/MSI/PowerShell etc...

If you want to do it using WiseScript, the link is here

http://www.symantec.com/connect/articles/editing-ini-file-using-wisescript


Comments:
  • http://www.itninja.com/question/vbscript-to-modify-already-installed-ini-file - jagadeish 11 years ago
  • VBScript!!!!!!!!!! - jagadeish 11 years ago
  • He has a working VB script just needs to know easiest way to push on 1000, he has never done a VBS that way - SMal.tmcc 11 years ago
Posted by: piyushnasa 11 years ago
Red Belt
0

I use this script to find and replace. There are many scripts in the forums but many of them do now work. I use this dynamic script which you can modify a little to suit your needs.

http://msiworld.blogspot.com.au/2012/07/vbscript-to-find-and-replace.html

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ