Pregunta

I am putting Kingsoft office on my flash drive, and I want to use a batch file to start the applications because the paths are not easily accessible, I cannon create a .lnk file because the path varies by computer because it may be plugged into a different port. Here is my batch file code, could somebody give some suggestions on how to make this work. Thanks in advance...

set "path=%~dp0"
start %path%office6\wpp.exe

The second line is the problem, the program won't start the program. Thanks!

¿Fue útil?

Solución

cd /d "%~dp0"
start "" /b wpp.exe

Otros consejos

I think some of the directory names in %path% contain spaces and since %path% is not enclosed within ""( double quotes), the script is unable to find the exe .

You may also want to include a log file so that it becomes easier to debug in case of any errors.

Try this:

set baseFolder=%~dp0
start "%baseFolder%office6\wpp.exe" > "%baseFolder%batchRunLog.log"
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top