.cmd file get relative path when running file on a server -


i have cmd file contains following command:

start h:\applications\mystoreapp\application.exe 

the file location in h drive (this mapped shared drive) in folder mystoreapp. want make cmd resolve it's location relatively this:

start .\application.exe 

i'm getting error since cannot resolve on remote host.

is there anyway solve without having enter specific location of file including mapped network drive?

%~dp0 path actual script directory (%0 script itself).

considering h:\applications\mystore\app\launcher.cmd

@echo "%~dp0application.exe" "h:\applications\mystoreapp\application.exe" 

or, heavy use :

@set $root=%~dp0 @rem remove last backslash @set $root=%$root:~0,-1% @start "app" "%$root%\app.exe" /config "%$root%\app.ini" /log "%$root%\app.log" 

quotes required in case of spaces in folder name.

for more information parameter extensions, see ss64.com.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -