Lukas Beran
Lukas Beran

Welcome to my blog! If you're looking for tutorials, hints or tips for IT, you're right here. You will find mostly articles on Microsoft products and technologies - operating systems, servers, virtualization, networks, management, but also the cloud. Sometimes I add some other interesting things.

August 2013


Changing system variable PATH

Lukas BeranLukas Beran

For easier work with own scripts or applications from command line it’s better to add the folder path to system variable PATH. After that, you can just write a name of the executable file without writing the whole path to the file, for example just app.exe instead of C:\myapps\app\app.exe. The change can be done from GUI Control Panel\System and Security\System — Advanced system settings, where on tab Advanced is button Environment Variables, where is possible to edit system variable PATH.

The second option is executing Setx in command line. You can add new path to the system variable PATH by setx Path "%path%;C:\MyNewPath". You can list the current content by echo "%path%".

The last option is PowerShell. You can add new path to the system variable PATH by $newPath = $env:Path + ';C:\MyNewPath' [Environment]::SetEnvironmentVariable('Path', $newPath, 'User').

If you want to change the variable PATH for all users, just change the last parameter to ‘Machine’.

My primary focus is the security of identities, devices and data in the cloud using Microsoft services, technologies and tools.

Comments 0
There are currently no comments.