| 1. |
Solve : batch file to change ini? |
|
Answer» I have a program installed silently on few windows 7 clients. Ok, it's easy to find out the current users profile location.Now is in line 42 I am not soure about that line, because line may change if you change settings in software which use settings.ini I need to test some more for that. yes I intent to supply batch to user by system and run batch file by system on every user when he logs in tool for editing settings.ini, I use notepad.If each path is different 1 batch won't suit your needs... Quote from: Blisk on March 05, 2015, 12:07:38 PM Now is in line 42 If you want an exact solution: then providing a sample settings.ini file with a description of which line needs to change will let someone help you. Quote
Notepad can't be scripted in a batch script. We need to know what tools can be used to edit your file within a batch script. here is settings.ini http://zerobin.povej.net/?91ea09e70c9e153b#bSapGkskui9/Ms46E8+zAnoVZourlGlpRMURDoW0MhA= about tool don't know what you mean. Installed is windeows 7 system. If there is needed some extra tool just let me know and I will check if I can install that on clients. I found some batch which is something like I need if that helps? But I can not complete it for my task. maybe can help for making my batch? Code: [Select]echo off set "file=%userprofile%\AppData\Local\Lotus\Notes\Data\notes.ini" if exist "%file%" ( findstr /v /i "IM_DISABLE= IM_DISABLED=" "%file%" >"%file%.tmp" >>"%file%.tmp" echo/IM_DISABLE=1 >>"%file%.tmp" echo/IM_DISABLED=1 move /y "%file%.tmp" "%file%" >nul )Give this a shot: Code: [Select]echo off call jrepl "^OutputFilePath=.*" "OutputFilePath=%userprofile%\documents" /f settings.ini /o - This uses a helper batch file called `Jrepl.bat` (by dbenham) - DOWNLOAD from: https://www.dropbox.com/s/4otci4d4s8x5ni4/Jrepl.bat Place `Jrepl.bat` in the same folder as the batch file or in a folder that is on the path. Be aware that Modern Windows protects the user from unknown downloaded files so it may be blocked - if you are happy to try it and it is blocked then * Right click the bat file * select the properties * and click unblock. runas administrator doesn't make any problem so yes I can use that in folder with batch.>Thanks this WORKS great! I have just one problem, replacing settings ini must be when software is off. So first I need to do is taskkill and than run this batch to change settings.ini Is there a way to check first if that settings is already changed and if it is, than won't change it? Like if name Mike exist in settings.ini than must be changed if it deosn't exist than it is already changed. OK I manage that by myself. Thank you for helping now all works great! |
|