There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware missing monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Solved: Batch File Help - Won't "exit"


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
jimi's Avatar
Distinguished Member with 3,780 posts.
 
Join Date: Jun 2000
Location: Land of Confusion
10-Aug-2005, 07:17 PM #1
Solved: Batch File Help - Won't "exit"
ok guys this one has me stumped, the following is a batch file thats run on a schedule.

C:\E-Com\EC-Connect\ECConnectsched.exe START
exit

the next is a screen shot of what happens when it's run, making me hit the X in upper right - any ideas??? , i want it to shut the window by itself.
Attached Thumbnails
solved-batch-file-help-won-1111.jpg  
__________________
Of course the game is rigged. Don't let that stop you - if you don't play, you can't win

There are too many people, and too few human beings.

Once upon a time I was your little rooster now am I just one of your cocks? great line courtesy of the greatest rock n roll band in the world, The Rolling Stones
Squashman's Avatar
Distinguished Member with 12,512 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
10-Aug-2005, 07:38 PM #2
start goes in front of the file you want to execute.
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
11-Aug-2005, 01:36 AM #3
Are you using Windows 95/98?
If so, find the *.bat file, Right Click>>Properties>>Programs>>Close On Exit>>Apply>>OK
jimi's Avatar
Distinguished Member with 3,780 posts.
 
Join Date: Jun 2000
Location: Land of Confusion
11-Aug-2005, 11:14 AM #4
thanks guys, start didn't work, brendan already had done what you suggest, and yes it's 98se, here's what did work

C:\E-Com\EC-Connect\ECConnectsched.exe START
@ echo off
cls
exit

been awhile since i wrote a batch pgm
ChuckE's Avatar
Senior Member with 1,853 posts.
 
Join Date: Aug 2004
Location: Redondo Beach, CA
Experience: Advanced
11-Aug-2005, 02:15 PM #5
Good that you resolved you issue, but I have a question:
Why do you have START at the end of the line?
What do you think it is doing?

According to the help on START it says:
Code:
C:\>start /?
Starts a separate window to run a specified program or command.

START ["title"] [/Dpath] [/i] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/WAIT] [/b] [command/program]
      [parameters]

    "title"     Title to display in  window title bar.
    path        Starting directory
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application
    I           The new environment will be the original environment passed
                to the cmd.exe and not the current environment.
    MIN         Start window minimized
    MAX         Start window maximized
    SEPARATE    Start 16-bit Windows program in separate memory space
    SHARED      Start 16-bit Windows program in shared memory space
    LOW         Start application in the IDLE priority class
    NORMAL      Start application in the NORMAL priority class
    HIGH        Start application in the HIGH priority class
    REALTIME    Start application in the REALTIME priority class
    ABOVENORMAL Start application in the ABOVENORMAL priority class
    BELOWNORMAL Start application in the BELOWNORMAL priority class
    WAIT        Start application and wait for it to terminate
    command/program
                If it is an internal cmd command or a batch file then
                the command processor is run with the /K switch to cmd.exe.
                This means that the window will remain after the command
                has been run.
Lines like "@ echo off" and "cls" don't really do anything that interesting.

Have tried to just remove the START? I believe it is because you have the START at the end of the line that you have opened a new process.
Since you then added the additional line of "cls" then that was enough to satisfy the need for the START, so then your last line of "exit" was able to close the window.

Again, since you are able to run your program without the leading START command, and the "@echo off" and "cls" don't really do anything, and finally the "exit" closes the window, my last question is why do you need the MS DOS window at all?
Why not just have a shortcut icon that runs "C:\E-Com\EC-Connect\ECConnectsched.exe" and be done with it?
__________________
Rehab is for quitters.
jimi's Avatar
Distinguished Member with 3,780 posts.
 
Join Date: Jun 2000
Location: Land of Confusion
11-Aug-2005, 03:09 PM #6
chucke what you posted sounds correct, the initial *.bat file i posted was sent to us by a vendor and i really didn't read it to notice the START cmd, but that be said i removed the start, echo off & cls commands and it still wouldn't close the window, so echo & cls are again in there. and why not just have a shortcut is because this program runs off a scheduled program that buried within our lousey pc based edi software.
__________________
Of course the game is rigged. Don't let that stop you - if you don't play, you can't win

There are too many people, and too few human beings.

Once upon a time I was your little rooster now am I just one of your cocks? great line courtesy of the greatest rock n roll band in the world, The Rolling Stones
ChuckE's Avatar
Senior Member with 1,853 posts.
 
Join Date: Aug 2004
Location: Redondo Beach, CA
Experience: Advanced
11-Aug-2005, 03:12 PM #7
Couldn't you just set up an "at" schedule, to do a scheduled task?
ChuckE's Avatar
Senior Member with 1,853 posts.
 
Join Date: Aug 2004
Location: Redondo Beach, CA
Experience: Advanced
11-Aug-2005, 03:37 PM #8
Ah wait! you said that this batch file runs off (from?) another scheduled program.
I think that program might be set up wrong to call the batch file.
I think might be what is hanging up your batch file.

If you really need this batch file then perhaps these lines might be better:
C:\E-Com\EC-Connect\ECConnectsched.exe
exit /b


The exit /b might force the current batch script to exit.
Perhaps instead a exit /b 0 to pass a "0" errorlevel back to the calling program.
Just a guess.
__________________
Rehab is for quitters.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:01 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.