tmourad
asked on
MS-DOS batch file created in ASP - Can't close it.
I have this code in ASP
Set MyFile_bat = fs.CreateTextFile(filename _bat, True)
strLine = "C:\MiniSoft\WS92\ws92_32. exe \\cmr\scripts\mis\minisoft \" & qmake("dt") & ".s92"
MyFile_bat.writeline strLine
***>>
MyFile_bat.Close
Set MyFile_bat = Nothing
-------------------------- ---------- ---------- ---------
which creates a batch file to run something else.
I can't seem to be able to close the batch file, which is my goal.
I've tried adding another line (see ***>> above)
MyFile_bat.writeline "exit"
- it writes 'exit', but doesn't seem to run it.
Anyone have ideas on how to close the batch file ?
Thanks.
Set MyFile_bat = fs.CreateTextFile(filename
strLine = "C:\MiniSoft\WS92\ws92_32.
MyFile_bat.writeline strLine
***>>
MyFile_bat.Close
Set MyFile_bat = Nothing
--------------------------
which creates a batch file to run something else.
I can't seem to be able to close the batch file, which is my goal.
I've tried adding another line (see ***>> above)
MyFile_bat.writeline "exit"
- it writes 'exit', but doesn't seem to run it.
Anyone have ideas on how to close the batch file ?
Thanks.
P.S. To run the batch file, just use WSHShell.run("filename") in VBScript:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthrun.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthrun.asp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what is interesting is if i write
MyFile_bat.writeline "cls"
instead of
MyFile_bat.writeline "exit"
it does actually clear the dos window.
so i don't get why exit wouldn't work too.
i will look further into your comments tomorrow.
thanks ! :)
MyFile_bat.writeline "cls"
instead of
MyFile_bat.writeline "exit"
it does actually clear the dos window.
so i don't get why exit wouldn't work too.
i will look further into your comments tomorrow.
thanks ! :)
sorry, i completely did not your question in a first place.
Please ignore my comment.
If i got it right this time - your bat file is done, but probably cmd or other container? for the bat is still active
You can try to create VBS script instead of Bat file and check how it is working.
Please ignore my comment.
If i got it right this time - your bat file is done, but probably cmd or other container? for the bat is still active
You can try to create VBS script instead of Bat file and check how it is working.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Answer by whammy
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
GaryC123
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Answer by whammy
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
GaryC123
EE Cleanup Volunteer
You need to look at Windows Scripting Host, that should solve your problem. ;-)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsobjwshshell.asp