| 1. |
Solve : Enable Batch File to Log Itself? |
|
Answer» I found this online:
Create a new batchfile called "logging.bat" and run that when you need to log it. The mybat.bat file can't be interactive because you won't see anything. Code: [Select]@echo off "c:\folder\mybat.bat" >"c:\folder\file.log" 2>&1 foxidrive - thanks. I've done it that way too. I've gotten used to not being able to see the script run, I'm OK with that. Can you help me make it work the way I described? Ultimately when it is run the script will ask if I want to enable logging. If I enter "yes" it will set NOWLOGGING equal to "yes" and the script will kick off the logging command . . . if you can help me make it work when NOWLOGGING=yes. Thanks, MJI don't know anything about your batch file and there are any number of scenarios that change the way it should be handled. I want to use the command to troubleshoot new scripts. Generally I work with the script opened in NOTEPAD++, I run the script and modify as needed. I just want to tailor the commands so the script logs its activity without me having to call it from the command line. My idea was to set a variable equal to "yes" at the TOP of the script. If this variable = "yes" then the script will log its activity to a text file that I can then look back over. If it is set to "no" the script will run as it was written to without logging itself. I don't know of a better way to capture where a script hangs up that doesn't involve calling the script from the command prompt or another script. I'm open to suggestions but also could still use help modifying those commands. Thanks, MJQuote from: powlaz on APRIL 08, 2014, 06:53:29 AM I don't know of a better way to capture where a script hangs up that doesn't involve calling the script from the command prompt or another script. I generally use echo statements to track the changes along with pause statements. That's the most friendly debugging that I know of. My file manager gives me an instant command line and enhanced access to launching and editing, which helps too. Does notepad++ allow you to call the batch code in DIFFERENT ways? |
|