I’m using Selenium + Robot Framework
Libraries used are RPA.Desktop and Process
Start Process notepad ----- works
Start process cmd ---- not working
Tried the following alternates
Start Process cmd.exe /c path_to_application – npthing happen
Start Process cmd /c start path_to_application — Launches commend prompt but not launching anything
path_to_application is not ‘.exe’ it’s ‘.lnk’.
We can double click on it to launch and also in the cmd I can give the path to launch the application.
But when used the same path in code with start process nothing happens.
The following command works
Start Process cmd /c start dir
But when I give application path it doesn’t work
Start Process cmd /c start applicationpath - launches cmd prompt and nothing happen
Probably the application needs a command window to have standard output. You should try to create a batch file (.bat or .cmd) with the launch command there.
A ‘.lnk’ file is a windows shortcut file, if you right click that file and select properties, you will find the path to the exe file that is the actual application, also you may find the shortcut provides some command line switches or options that it passes to the exe, so you’ll need to note those and pass them to Start Process too.
Also when you get a software update you may need to check of the shortcut file gets updated, it’ll be a good idea to let the dev team know you’re not using the actual shortcut file, but running the command it runs, and if they update it they should let you know what they changed.
Thanks for the response. Yes I got the path from properties only. moved the location of the .lnk to different folder from desktop and it worked. Thanks for the help.