Windows batch script to read an .ini file

Here’s a command file (ini.cmd) you can use to extract the relevant values: @setlocal enableextensions enabledelayedexpansion @echo off set file=%~1 set area=[%~2] set key=%~3 set currarea= for /f “usebackq delims=” %%a in (“!file!”) do ( set ln=%%a if “x!ln:~0,1!”==”x[” ( set currarea=!ln! ) else ( for /f “tokens=1,2 delims==” %%b in (“!ln!”) do ( set … Read more

Windows Batch: How to add Host-Entries?

I would do it this way, so you won’t end up with duplicate entries if the script is run multiple times. @echo off SET NEWLINE=^& echo. FIND /C /I “ns1.intranet.de” %WINDIR%\system32\drivers\etc\hosts IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^62.116.159.4 ns1.intranet.de>>%WINDIR%\System32\drivers\etc\hosts FIND /C /I “ns2.intranet.de” %WINDIR%\system32\drivers\etc\hosts IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^217.160.113.37 ns2.intranet.de>>%WINDIR%\System32\drivers\etc\hosts FIND /C /I “ns3.intranet.de” %WINDIR%\system32\drivers\etc\hosts … Read more

Windows Aero: What color to paint to make “glass” appear?

Color fillColor = Color.FromArgb(0, 0, 0, 0); //(a, r, g, b) e.Graphics.FillRectangle(new SolidBrush(fillColor), e.ClipRectangle); This is actually rather amusing. It means that you are drawing something completely transparent – so this changes absolutely nothing! 🙂 Guess: if black (0,0,0) should mean “glass”, how about drawing (1,1,1) to get (almost) black?

Any tool/software in windows for viewing ELF file format? [closed]

readelf and objdump are both excellent utilities if you are on a Unix box. Both are provided by Cygwin. readelf will give you a good overview of the ELF header information, section headers. You can also use it to get relocation and symbol information. Overall, readelf can give greater detail on the contents of an … Read more

How do you set java version in windows git bash?

Let’s say you want to try other Java versions but you don’t want to alter the Windows environment variables. Steps: Go to your home folder. i.e. C:\Users\MyAccountName Edit the .bashrc file and add the following code below. #For example: export JAVA_HOME=’/c/Program Files (x86)/Java/jdk1.8.0_45′ export PATH=$JAVA_HOME/bin:$PATH .bashrc and .bash_profile are files created during the git-bash installation.

How to Shorten Git Bash Prompt (Windows)

An alternative answer is to go to C:\Program Files\Git\etc\profile.d and open the git-prompt.sh file. It contains the default configuration/prompt for Git Bash. if test -f /etc/profile.d/git-sdk.sh then TITLEPREFIX=SDK-${MSYSTEM#MINGW} else TITLEPREFIX=$MSYSTEM fi if test -f ~/.config/git/git-prompt.sh then . ~/.config/git/git-prompt.sh else PS1=’\[\033]0;$TITLEPREFIX:$PWD\007\]’ # set window title PS1=”$PS1″‘\n’ # new line PS1=”$PS1″‘\[\033[32m\]’ # change to green # PS1=”$PS1″‘\u@\h … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)