You may want to try this:
exec("start /min $filename") || die "Could not launch batch file\n";
-jbWare
| [reply] [d/l] |
Wow, that works. Thank you all very much. Have a peaceful day.
| [reply] |
Yep, that works, but in the spirit of TIMTOWTDI: PAR has a '--gui' option that will suppress a command prompt.
Note: Unfortunately ActiveState PPM has a stale copy of PAR. You'll have to perl -MCPAN -e "install PAR" instead, but this will work fine. No C compiler is required to use PAR. This is a cool trick especially if you have Tk apps and you don't want to run them from a DOS box at all. But yes, you don't want a Tk app...is this still useful? Maybe.
If you didn't spawn a GUI in your app, I would theorize this would create a background process that would just go on it's merry way without ever appearing on the Windows desktop. Another option would be to have your Perl app install itself as a Win32 service -- not being a hardcore Windows user -- I have yet to experiment with that possibility.
| [reply] [d/l] |
It won't appear in the task bar, but could you use Win32::Process::Create with the CREATE_NO_WINDOW option? You can certainly run batch files invisibly with this method.
--
I'd like to be able to assign to an luser
| [reply] [d/l] |
What exactly are you looking for? Do you not want them to see the console window flash by their eyes, or does your script do more than just execute a batch file then exit?
With perlapp from ActiveState, you can add some simple Tk to just have a nice window that says "My App Name" and give them a button which allows them to exit the app, then compile with the --gui option. Heck, you could even make it a one pixel window and destroy it yourself at the end of your script. If you control the computer which they use your .exe on, you can tell windows to launch it minimized (go to Properties and set Run: to "minimized" instead of "Normal Window."
- - arden. | [reply] [d/l] |
Basically the batch file will launch some other GUI apps. That's why I want to minimize the perl app console window. Do we really need to create a Tk window app since there's no click event required ?
| [reply] |
No, you don't need to, it is just one option. Again, what exactly do you want? I'm not sure if you don't want to see perl's console window or the batch file's console.
Again, if you control the computers it is run on, right-click on your compiled script, go to "properties", and change the Run: field to "minimized" instead of "Normal Window". It's not a perl way of doing it, but aside from the --gui option provided by perlapp, I can't think of another solution. I know that by adding Tk you'll increase your executable size by about 800 Kb, but if size isn't a concern for you, it is an aesthetic way of handling the issue. In fact, although I've never tried it, I don't think you have to use Tk to use the --gui option at all, it just won't have a console.
Alternatively, have you looked at perltray within the PerlDevKit? I haven't used it, but it looks like a different way of accomplishing the task you're looking for, but I can only imagine that it will also add ~1 MB to your executable.
- - arden.
| [reply] [d/l] [select] |