# Run a program after build (windows)

Can I launch a program after building my program with Build Automation?
DoShellCommand does not work on windows.

Add this to a build script:

Dim command As String = CurrentBuildLocationNative + CurrentBuildAppName Call DoShellCommand("""" + command + """")

Then make sure your script is after the build step it and it works fine.

https://www.dropbox.com/s/k5zbapvi9hw5y74/TestRunAfterBuild.xojo_binary_project?dl=1

Thank you, but it does not work on windows10.
I have xojo release 3.

It does work for me on Windows 10 using 2018R3, but I did have to change the “Applies” option under Behavior to “Release” or the debug article was launched a second time & couldn’t connect back to the IDE. @JulianS’s script does work, so what is your command?

Nice Wayne, thanks, I’ve not used Built Setting before so I just fudged my way through it I also have w10 and 2018r3 and it works fine here. Christiano, did you try the project I linked? it should work without any modification and doing what Wayne mentions fixes a double run attempt when debugging, which is noice. Does it give an error, if not what happens? I assume you are registered to build? (just checking, you never know)

Thank you, but it does not work on windows10 1803, windows pro.

I tried with your project, but it does not work.
I have no error message, but xojo stops responding during building.

I registered my Xojo.

If you change the script in my project to:

Dim command As String = CurrentBuildLocationNative + CurrentBuildAppName Print command //Call DoShellCommand("""" + command + """")

Does it display a popup with the command string inside?

If so, could you screenshot it, upload it and put a link here?

I’ve just found a problem with DoShellCommand and I want to double check it first before I report it as I can’t get it to make the IDE not respond, but I can get it to not work as you mentioned before.

Try uncommenting the DoShellCommand call and replace Call with Print, like this:

Print DoShellCommand("""" + command + """")

What do you get then?

Something funny going on here, I now have it displaying the Print twice when I build.

Still none the wiser as to why its not working though.

Silly question Cristiano, have you tried restarting Xojo and/or your computer?

[quote=414199:@JulianS]Something funny going on here, I now have it displaying the Print twice when I build.

Still none the wiser as to why its not working though.

Silly question Cristiano, have you tried restarting Xojo and/or your computer?[/quote]
Well yeah, I was trying to figure out what the return value was. Just in case there was an error.

Hehe yeah, but I only have one Print, but its showing twice I’ll make a feedback on that and another issue I found when I get back to my desktop.

I tried with Print DoShellCommand("""" + command + “”"")
nothing new, I have no error message, but xojo stops responding during building (see picture n. 2)

[quote=414205:@Cristiano Emilio Vicini]I tried with Print DoShellCommand("""" + command + “”"")
nothing new, I have no error message, but xojo stops responding during building (see picture n. 2)[/quote]
Have you tried creating a new user? It strikes me that the . In your username may be causing problems.

Ive got an apostrophe in mine, so I run into issues like this too.

Nothing
I tried with another path, another exe but nothing, always pciture 2

Did you try a path that does not include your user name, such as C:\TEMP\MyTest ? (and not C:\Users\Christiano E. Vicini\Temp…)

Yes, I tried.
I tried also with another program,
for example calc.exe of windows
I tried also before building, and in debug, but nothing, xojo stops responding.

Could you try switching the project to 32bit and see if its any different as I’m seeing some different behaviour doing that? Could you also try my project in a previous version of xojo?

Does it stop responding until you close the launched App? Maybe then Xojo waits until that process has finished before it’s able to continue

What happens if you launch your executable in a different way?

call DoShellCommand("start /D ""C:\\Path\\to my app\"" MyApp.exe")

Nothing, I tried with 32bit, with call DoShellCommand(“start /D ““C:\Path\to my app”” MyApp.exe”), and other but nothing,
it seems that the xojo waits until that process has finished.
I have only xojo 3 release.