Error “‘git’ is not recognized as an internal or external command”

Have you correctly set your PATH to point at your Git installation? You need to add the following paths to PATH: C:\Program Files\Git\bin\ C:\Program Files\Git\cmd\ And check that these paths are correct – you may have Git installed on a different drive, or under Program Files (x86). Correct the paths if necessary. Modifying PATH on … Read more

How to run Java program in command prompt

javac is the Java compiler. java is the JVM and what you use to execute a Java program. You do not execute .java files, they are just source files. Presumably there is .jar somewhere (or a directory containing .class files) that is the product of building it in Eclipse: java/src/com/mypackage/Main.java java/classes/com/mypackage/Main.class java/lib/mypackage.jar From directory java … Read more

How to add a set path only for that batch file executing?

Just like any other environment variable, with SET: SET PATH=%PATH%;c:\whatever\else If you want to have a little safety check built in first, check to see if the new path exists first: IF EXIST c:\whatever\else SET PATH=%PATH%;c:\whatever\else If you want that to be local to that batch file, use setlocal: setlocal set PATH=… set OTHERTHING=… @REM … Read more

Batch file to split .csv file

Try this out: @echo off setLocal EnableDelayedExpansion set limit=20000 set file=export.csv set lineCounter=1 set filenameCounter=1 set name= set extension= for %%a in (%file%) do ( set “name=%%~na” set “extension=%%~xa” ) for /f “tokens=*” %%a in (%file%) do ( set splitFile=!name!-part!filenameCounter!!extension! if !lineCounter! gtr !limit! ( set /a filenameCounter=!filenameCounter! + 1 set lineCounter=1 echo Created !splitFile!. … Read more

How can I display my current git branch name in my PowerShell prompt?

An easier way would be just installing the Powershell module posh-git. It comes out of the box with the desired prompt: The Prompt PowerShell generates its prompt by executing a prompt function, if one exists. posh-git defines such a function in profile.example.ps1 that outputs the current working directory followed by an abbreviated git status: C:\Users\Keith … Read more