If I have my path set as follows:
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
I need it to be set as follows:
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
I am using the following code to fetch the first parameter:
@echo off
setlocal EnableDelayedExpansion
set c=1
for %%A in ("%path:;=";"%") do (
set b[!c!]=%%~A
set /a c=c+1
)
echo !%b[1]%!
pause
But I cannot seem to find a way to cut the output string from the PATH variable.
for /F "tokens=1* delims=;" %%a in ("%path%") do echo %%b
– Aacini