windows - Program management, according to whether it was started directly or with another file by dragging its icon. (batch) -


when start batch file double-click, in variable %1 echo off. when start batch file, file (drag&drop) batch file icon, in variable %1 contains path file started with.

i need thing: program start when in %1 echo off. goto when in %1 else, goto b

i tried many potetial solutions problem, of thin doesn´t work. tried find , findstr , 1 of combination of for. have feeling impossible in batch.

you don't echo off inside %1. when double click batch file there not arguments, %1 empty , echo %1 parsed , converted echo (no arguments, no value echo) , when executed without parameters echo shows current echo status.

for start point can use like

@echo off     setlocal enableextensions disabledelayedexpansion     if "%~1"=="" goto :eof 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -