A handy alternative to Alias in windows command

A recent encounter in windows server where a need for a folder alias was unavoidable, we made a discovery that unlike linux, folder alias is hard to achieve in windows command for windows version less than windows 10. Though it is achievable, it is hard to achieve when the target directory path is dynamic. This lead to a search for the alternative to deploy in this scenario. The scenario was when we have to use the editbin.exe and its LARGEADDRESSAWARE where we discovered that LARGEADDRESSAWARE take only a particular character length for the input file and if there are more then it will trim it. This was leading to an error.

The alternative was to CD into the folder and execute the command and get out of the folder. And we have something called as setlocal which help us achieve this by scoping the step in and out of a folder. Setlocal will help us scope the working directory and reverts the working directory when the scope is over. The below snippet shows how we can achieve this. I was using this in VisualStudio postbuild event.

setlocal
cd
cd $(TargetDir)
cd
IF EXIST C:\masm32\bin\editbin.exe (
  C:\masm32\bin\editbin.exe /LARGEADDRESSAWARE $(TargetFileName)
) 
endlocal

Setting Up Kafka

Apache Kafka is a high-throughput, low-latency event processing system designed to handle millions of data feeds per second. It has the c...… Continue reading

Libish Varghese Jacob

Libish Varghese JacobI am a lead engineer at a prominent wind turbine manufacturing firm. My interests span a diverse range, and immersing myself in technology is one of them. This platform serves as my primary knowledge base, where I seek information and insights. Moreover, I utilize this platform to share my experiences and experiments, hoping they may benefit those following a similar path. It's important to note that the suggestions I express here are based on my best knowledge at the time of writing and may not necessarily represent the optimal solutions. I wholeheartedly welcome any comments you may have to improve or refine my ideas. Your feedback is greatly appreciated and valued.