|
-
April 24th, 2001, 01:35 PM
#1
Registered User
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.
-
April 24th, 2001, 01:44 PM
#2
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
-
April 24th, 2001, 05:01 PM
#3
Registered User
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.
-
April 25th, 2001, 06:20 AM
#4
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!
-
April 25th, 2001, 01:26 PM
#5
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...
-
April 25th, 2001, 01:43 PM
#6
Registered User
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.)
-
April 25th, 2001, 02:43 PM
#7
-
April 25th, 2001, 03:30 PM
#8
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
-
April 25th, 2001, 04:26 PM
#9
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.
-
April 25th, 2001, 05:14 PM
#10
Registered User
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.
-
April 26th, 2001, 07:22 AM
#11
Registered User
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
-
April 26th, 2001, 09:34 AM
#12
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.
-
April 26th, 2001, 09:51 AM
#13
Registered User
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
-
April 26th, 2001, 10:00 AM
#14
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?
-
May 7th, 2001, 05:33 AM
#15
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks