eksime / VDesk

Launch programs on new virtual desktops.
GNU General Public License v3.0
625 stars 57 forks source link

Can't open some apps through a .bat file, but when I call the directly in PowerShell #73

Open TobiasDev opened 4 years ago

TobiasDev commented 4 years ago

I have an issue that I'm not sure how to solve.

When I call some apps directly in Powershell written like this:

vdesk on:4 run:"C:\Program Files\Joplin\Joplin.exe"
vdesk on:5 run:"C:\Users\Name AnotherName\AppData\Local\Discord\Update.exe" --processStart "Discord.exe"

That works, however, when I try to do something similar in a .bat file I can't get it to wok (probably since there are space in the names).

powershell -command "vdesk on:4 run:C:\Program Files\Joplin\Joplin.exe"
powershell -command "Start-Sleep -s 10"
powershell -command "vdesk on:5 run:C:\Users\Name AnotherName\AppData\Local\Discord\Update.exe" --processStart "Discord.exe"

I also tried:

powershell -command "vdesk on:4 run:'C:\Program Files\Joplin\Joplin.exe'"
powershell -command "Start-Sleep -s 10"
powershell -command "vdesk on:5 run:'C:\Users\Name AnotherName\AppData\Local\Discord\Update.exe' --processStart 'Discord.exe'"

Neither of these worked. Does anyone know how I can solve this?

angrybee commented 3 years ago

Did you try something like

vdesk on:4 run:"C:\Program Files\Joplin\Joplin.exe"
timeout 10
vdesk on:5 run:"C:\Users\Name AnotherName\AppData\Local\Discord\Update.exe" --processStart "Discord.exe"

in your *.bat without using any powershell command for vdesk?