The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for January 8th, 2025

Adding entries to the PATH persistently (be aware of the 1024 character limit of SETX)

Posted by jpluimers on 2025/01/08

Directly after a new Windows installation, I want to have my cloned git repository of batch files in the PATH persistently so that it gets searched after rebooting or opening a new console window.

At that moment, there is not much of a 1024 PATH character limitation, but be aware about that limit if you try this yourself.

This is my add-current-directory-to-path-at-end.persistent-and-limit-to-1024-characters.bat:

:: https://serverfault.com/questions/664180/can-i-permanently-add-to-path-in-windows-using-batch
:: https://superuser.com/questions/812754/how-to-recover-from-path-being-truncated-to-1024-characters-by-setx
:: global environment
setx PATH "%PATH%;%CD%"
:: local process
:: https://superuser.com/questions/975605/add-current-directory-to-path
set PATH=%PATH%;%CD%

I execute it from within the cloned git directory.

Oh: you need to double-quote the SETX parameters, otherwise you get an error message: “ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).“.

More links than the above ones from the batch file, especially on the 1024 character limitation:

Read the rest of this entry »

Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows | Leave a Comment »

On Windows, `arp -d` sometimes fails but `netsh` comes to the rescue

Posted by jpluimers on 2025/01/08

(All below statements were run elevated as Administrator)

I had arp -d fail with any parameter combination on one of my systems always throwing the error The ARP entry deletion failed: The parameter is incorrect..

Luckily I found out that this did clear the ARP cache correctly:

netsh interface ip delete arpcache

I found that via [Wayback/Archive] “The ARP entry deletion failed: The parameter is incorrect.” – Recherche Google:

Read the rest of this entry »

Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows, Windows 10, Windows 11, Windows 7, Windows Development | Leave a Comment »