more .bat file questions...
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 31

Thread: more .bat file questions...

  1. #1
    Registered User tablesalt's Avatar
    Join Date
    Jan 2001
    Location
    Nashua, NH
    Posts
    174

    Post more .bat file questions...

    Windows 9x will not close a DOS box that a batch command just ran in. Instead it is left open to be closed manually with a "finished" posted in the title bar. Is there anyway to get this to close on its own once its done? I thought the "exit" command might do this, but did not work. NT/2000 do not have this problem.

  2. #2
    Darren Wilson
    Guest

    Post

    Right click - Properties - check box that says Close on Finish or similar. Win2K hasn't got that option, but it should be available in 9x/ME

  3. #3
    Registered User tablesalt's Avatar
    Join Date
    Jan 2001
    Location
    Nashua, NH
    Posts
    174

    Post

    I thought of that option, but the problem with it is, this batch file is being launched via hyperlink from a web page on an intranet. In this way there is no way to set such properties.

  4. #4
    3fingersalute
    Guest

    Post

    What if you put exit at the end of the batch file?...Also, there should be a pif file somewhere from the bat file that you can edit to close on exit!

  5. #5
    Registered User
    Join Date
    Aug 1999
    Location
    Memphis, TN, USA
    Posts
    345

    Post

    Are you just trying to dig every bit of batch file knowledge I still retain out of my head?

    There was a command line paramater you passed that forced the window shut when the batch finished. I just don't remember it at the moment.... but I still have some books that list it, so I'll check on it tonight...

  6. #6
    Registered User FooL's Avatar
    Join Date
    Nov 2000
    Location
    Uter
    Posts
    280

    Post

    I've learned .bat file little by litte. Mostly editing them and seeing what changes. But this is what I put in to make it go away. Anyone feel free to correct me if I'm wrong.

    @ECHO OFF (at the beginning of the file.

    ***body of .bat file***

    :END(at the end of the file.)

  7. #7
    Registered User
    Join Date
    Aug 1999
    Location
    Memphis, TN, USA
    Posts
    345

    Post

    I thought that was it too, but the sample batch I gave to Compaqman included an :end statement. So I guess the question is did he use it or not?

    Well, didja?

    EDIT: err, well I thought it did, but I just went to look in that thread and I didn't put it in. If there isn't and END statement in there Compaqman, add it and that should do it!

    Props to FooL, who isn't living down to his / her moniker....

  8. #8
    Registered User
    Join Date
    Dec 1999
    Location
    Columbus Ohio U.S.A.
    Posts
    194

    Post

    if windows didnt, then you need to copy the pif file created by what Mr. Wilson said to do into the directory of the batch file.

    right click/properties/program/close on exit created a pif in that directory for me

    although I just did it locally, it did work using html and run from current location.

    Will play on my lan at home tonite and let you know what happens

  9. #9
    Registered User
    Join Date
    Dec 1999
    Location
    Columbus Ohio U.S.A.
    Posts
    194

    Post

    ok I had to copy the pif file from my windows\pif directory but once I did this it works fine accross my peer to peer lan using html to link to the file.

  10. #10
    Registered User tablesalt's Avatar
    Join Date
    Jan 2001
    Location
    Nashua, NH
    Posts
    174

    Post

    Unfortunately putting an :end at the end of the file did not work for me. I'm to the point where I just put in "echo Please close this window when completed." As far as the issue regarding the PIF file. This would typically work except for the fact that as I stated to Darren that the file is being launched from a hyperlink on a intranet page so does not reside on the local hard drive.

  11. #11
    Registered User Higg's Avatar
    Join Date
    Jul 1999
    Posts
    295

    Post

    Originally posted by Student^2:
    There was a command line paramater you passed that forced the window shut when the batch finished. I just don't remember it at the moment
    I agree with student... there must be a parameter I don't remember that works with this... perhaps it's a "COMPSPEC=something" line you need or a "COMMAND.EXE /whatever" that overrides the current command-instance and does the job.
    In every case is the purpose of the ":END" thing only to have label for pseudo-structured programming... nothing more! You can simply point a "GOTO :END" to the end, but it does nothing else than to be a LABEL.

    Hope that helps... Higg

  12. #12
    Registered User
    Join Date
    Jan 1999
    Location
    London, Great Britain
    Posts
    300

    Exclamation

    Umm, just a thought, but should you really be calling a batch file from a link on a webpage?

    Letting users run batch files through the web server is quite a large security hole!

    You could always write a bit of ASP script instead to call the functions you want.

  13. #13
    Registered User Higg's Avatar
    Join Date
    Jul 1999
    Posts
    295

    Post

    Originally posted by antonye:
    Letting users run batch files through the web server is quite a large security hole!
    I'd do the same, as I feel more comfortable with batches - even though I totally agree with you

  14. #14
    Registered User
    Join Date
    Aug 1999
    Location
    Memphis, TN, USA
    Posts
    345

    Post

    Just found out that (under NT)
    Code:
     cmd.exe /c myfile.bat
    will do exactly what you want. It opens a new instance of the command interpreter for running whatever, and closes ti when done. I don't have a 98 box handy, but maybe it will work with command as well?

  15. #15
    Registered User
    Join Date
    Mar 2001
    Location
    NEW JERSEY
    Posts
    27

    Post

    Is there a website that would show the parameters for a batch file?
    I have found myself writing a bunch of them
    lately and would like some guidance
    Thanks for all the help

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •