| 1. |
Solve : Close the current program with a batch file? |
|
Answer» I'd like a way, if possible, to close the current running program through a batch file. By the way, this isn't homework, although it is starting to sound like it huh? Is everyone getting PARANOID? I doubt you can do this in batch. In fact even using the Windows Shell, you can only kill Explorer windows. One solution would be to use Word (don't ask) which can enumerate the open windows and more importantly close them. Code: [Select]Set wd = CreateObject("Word.Application") Set colJobs = wd.Tasks For Each job In colJobs If job.Visible = True And job.Name <> "Program Manager" Then colJobs(job.Name).Close End If Next wd.Quit Save with a vbs extension and run from the Windows run box as wscript scriptname.vbs. Use a path to the script if necessary. Good luck. Wow, that was more effective than I thought, I neglected to close what I had open because for some for some reason I expected it to fail, things like this usually don't work for me. That's great, just what I need. Thanks a lot Sidewinder! |
|