sindresorhus / open

Open stuff like URLs, files, executables. Cross-platform.
MIT License
3.18k stars 218 forks source link

target bat file not opening when app argument defined as cmd (windows 10) #67

Open neilmahaseth opened 7 years ago

neilmahaseth commented 7 years ago

This works opn('H:\command.bat');

but this just opens a command prompt without executing the the target bat file.

opn('H:\command.bat', {app: 'cmd'});

Tested on windows 10

neilmahaseth commented 7 years ago

As a workaround to the problem the following code allowed the use of app and arguments.

opn('',{app:['cmd.exe','/c start H:\command.bat "argument"']});