Indigo Rose Software
  #1  
Old 01-12-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
DOS and Batch files

I am working on trying to launch an application not in association with AMS by using a batch file. I have no problem with launching the file, but in Win2k the command window remains open after the launch of the application and if you close the command window, the application launched by the command window also closes.

Does anyone have any suggestions on how to launch a program using a batch file and then be able to close the command window that the batch file used but have the launched application remain open.

Thanks
__________________
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
Reply With Quote
  #2  
Old 01-12-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Sure there's a couple ways. You have to mess around and figure which one is best. One way is to pipe the output to a file by using a > character. Another way might be to terminate it from AMS. Also if you create a shortcut to a batch file you can set the chortcut to run the console window minimized. So if you have an exit command in your batch file, the user would never see it.

Anyhow to make it simple start here and see if this is all you need:

http://www.computerhope.com/issues/ch000320.htm

Let me know if that doesn't work and we'll try something else.
Reply With Quote
  #3  
Old 01-12-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
Thanks Corey, I will give it a try, but I think it is a problem with 2000 and xp where it will not exit the command window if it is still running the program. The product we are launching is a Java program.

I will try it tomorrow.

Tigg
__________________
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
Reply With Quote
  #4  
Old 01-12-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
I'm certain there are ways to have the batch file window close in XP with the launched program still running. I've done it. We'll figure it out, although it may require a combination of steps.

For example what if you created a small .exe in AMS to kill the batch file window, and then launched that from the batch file after the java program? I mean that's obviously way too sketchy to be the best solution but it just illustrates that where there's a will there's a way. For sure you can run any batch file minimized by creating a shortcut to it, then right clicking on the shortcut and going into the properties and selecting "Run : minimized".
Reply With Quote
  #5  
Old 01-13-2005
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
You could try adding these two lines to the end of your batch file so it will close automatically once the commands are done:

@echo off
cls

As for making cmd not wait for the application to terminate, you could try using the START command:

START <filepath>
__________________
--[[ Indigo Rose Software Developer ]]

Last edited by Lorne; 01-13-2005 at 12:57 PM.
Reply With Quote
  #6  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Quote:
Originally Posted by Lorne
No need for anything fancy...just add these two lines to the end of your batch file and it should close automatically:

@echo off
cls
I thought that only works in Win9x?
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #7  
Old 01-13-2005
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
I've edited my post a bit, but I think that works in XP as well. Not sure about NT (it's been a looooooong time since I've used NT).
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #8  
Old 01-13-2005
csd214 csd214 is offline
Forum Member
 
Join Date: Oct 2001
Location: Norway
Posts: 939
Quote:
Originally Posted by Lorne
cls
Clear Screen?
Do you mean 'exit'?
Reply With Quote
  #9  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Quote:
Originally Posted by Lorne
I've edited my post a bit, but I think that works in XP as well. Not sure about NT (it's been a looooooong time since I've used NT).
I tried quite a few yesterday... and found that there seems to be no way to do this at this time (maybe a 3rd party application or some guru M.S. agent will be of help though)



__________________
Intrigued
www.amsuser.com

Last edited by Intrigued; 01-13-2005 at 01:31 PM. Reason: edited due to usually hyper-type-syndrom happening
Reply With Quote
  #10  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Quote:
Originally Posted by csd214
Clear Screen?
Do you mean 'exit'?
Actually CLS I read is suppose to work on Win9x machines for example.
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #11  
Old 01-13-2005
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
CLS, which clears the command console (a.k.a. DOS prompt).

AFAIK this is still required in XP when you're invoking the command prompt by executing a batch file.
__________________
--[[ Indigo Rose Software Developer ]]
Reply With Quote
  #12  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Lorne, last night I created a batch file (test.bat) and just had one line coded in:

START filepathandnameofprogramhere

It started up... I just could not find a way to close the command prompt from the batch file. ;-(

(The system is running Win XP Home, btw)
__________________
Intrigued
www.amsuser.com
Reply With Quote
  #13  
Old 01-13-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Hi guys. Making a batch file run and go away without seeing it is in this example, see attached. When you run "runme" you won't see a thing hopefully but you will see a new text file appear next to your batch file.

Anyhow that's this, if this doesn't help your specific scenario Tigger, let me know and I'll show you a couple more methods. Bottom line, it's definitely do-able. The only question is can we get away with doing it this way or do we need to create code in our main AMS project to kill the DOS window too. Either way I remember doing this a few times for little utilities I've built in AMS and I always was able to get it working, so...
Attached Files
File Type: zip tigger.zip (609 Bytes, 107 views)
Reply With Quote
  #14  
Old 01-13-2005
Intrigued's Avatar
Intrigued Intrigued is offline
Indigo Rose Customer
 
Join Date: Dec 2003
Location: Location! Location!
Posts: 6,059
Waitttt.. that's two files!



__________________
Intrigued
www.amsuser.com
Reply With Quote
  #15  
Old 01-13-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
For the following to have any impact, you must say it like Edward G. Robinson:

What files? I don't know nothin' 'bout no files, See? Yeah... See? I didn't see nuttin'! See? Nuttin'! Yeah...

That's the official corporate response anyhow...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DOS commands John_Klassek AutoPlay Media Studio 5.0 4 09-16-2004 09:48 AM
Running Batch files with attributes jimmy guilfoyle AutoPlay Media Studio 4.0 3 12-05-2003 06:07 AM
Output DOS Commands (or batch files) to AMS4 Page (textBOx Object) Is it possible? Martin_SBT AutoPlay Media Studio 4.0 8 10-30-2003 09:32 AM
Reading from DOS environment Lorne Setup Factory 6.0 4 04-05-2002 12:00 AM
Running a batch file racedog AutoPlay Menu Studio 3.0 2 05-11-2001 02:55 AM


All times are GMT -6. The time now is 02:46 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software