You are not logged in.
Pages: 1
Okey I have this code:
@ECHO off
SETLOCAL
set found=
FOR /F "tokens=1-3 delims= " %%a IN ('REG QUERY "HKEY_CLASSES_ROOT\Applications\exampleprogram.exe\shell\open\command"') DO (
set found=%%c
)
for /f "tokens=1-2" %%a in ("%found%") do (
set mypath=%%a
)
echo %mypath%
ENDLOCAL
and result is: "C:\Somefolder\Exampleprogram\exampleprogram.exe"
QUESTION IS HOW TO GET RESULT WITHOUT exampleprogram.exe (like this: "C:\Somefolder\Exampleprogram" )
Offline
Use
set mypath=%%~dpa
The d returns C:\ and the p returns Somefolder\Exampleprogram
You can look at the output of for /? for additional options.
Offline
Use
set mypath=%%~dpa
The d returns C:\ and the p returns Somefolder\Exampleprogram
You can look at the output of for /? for additional options.
Thank you works like a charm!!!
Offline
Pages: 1