| 1. |
Solve : Batch File and DOS Window Problem? |
|
Answer» Hi There is nowhere to store information about how it is to be ran Thats what PIF files are for. PIF means Program Information File. Thats why you can run them minimized, maximized, in a window, in DOS mode, prevent them from detecting windows, auto close when finished, etc.I have had time to use the advice given above and to test it. There appears to be a further problem as it runs but maximized. When the batch files are run by me they run minimized; click on shortcut on desktop. When they are run from Win XP Schedule they run maximized. All files involved (.bat and .txt log files) have been set to run minimized. Now I really am stuck as the schedule program doesn't have a run minimized property that I can find. Does anyone have any ideas please. Many thanks [glb]ScriptHam[/glb]See what the command start does (start->run: CMD and then start /?). Make another batch file, let's say startm.bat, where you will have only one line: start /min your_batch_that_should_be executed.bat (the one that you already have, not startm.bat). startm.bat should be called by WinXP scheduler. Make your adjustments now (to close itself when it finishes for example). Does it work now?Thankyou Viking for your advice. I made some tests as follows. I MAY have not understood your last sentence but one. Quote Make your adjustments now (to close itself when it finishes for example) How do I adjust it to close itself? Experimenting with minimized files produced the following: Code: [Select] @echo off call C:\batch\simple_xcopy.bat :: echo running xcopy_simple.bat Test 0. Call -> Run -> CallSimple.bat Result. Dos Window opens and closes. Otherwise OK Test 1. Start /min -> CallSimple.bat Result. Dos Window opens in taskbar BUT never closes, so number that are open increases. Also opens briefly on screen and closes. Otherwise OK. Test 2. Click desktop shortcut to CallSimple.bat Result. No Dos Window, otherwise OK. Test 3. Adjust batch file to call "Shortcut to CallSimple.bat." And adjust schedule to call "Shortcut to Simple_xcopy.bat.". Should these be .bat.Ink files or similar? Result. Proposed but not tested yet. Is it worth doing? Is this more or less what you recommended? I hope it is. Does anything spring to mind regarding the accumulating DOS window entries in the taskbar? I think this is very promising, shame its not more simple. I look forward to hearing from you. [glb]ScriptHam[/glb] :)ADDENDUM to post above. Test 3. Adjusted batch file to Code: [Select] start /min C:\batch\"shortcut to simple_xcopy.bat.lnk" And adjusted schedule to call "Shortcut to CallSimple.bat". Although it just reads CallSimple.bat Result. Seems to work in that log file entries are made and the DOS window makes a momentary appearance on screen and in taskbar. This is definitely progress. But it does not add empty lines to the log file, log.txt, the code to do this is Code: [Select] Echo. >> log.txt Echo. >> log.txt Echo. >> log.txt Up until a few hours ago these three lines were added as the batch file ran. In the properties of the SHORTCUTS I have set the DOS window to 1pxl*1pxl BUT it flashes on screen at natural or normal size. Can this be rectified please. These are not severe problems but if there is a quick fix I would prefer it. The log file is difficult to read without. Many thanks for help so far. [glb] ScriptHam [/glb] |
|