1.

Solve : It shouldn't be this difficult...?

Answer»

Hello all,

I am new to the forum here and I really just joined because I have a very specific question REGARDING batch files. I am trying to create a batch file that will open a log file in a log file viewer so that when the following installation process runs, the user can see when it is completed (the installation gives no on screen prompts and using the log file is the only way to know for certain that the installation took.) The log file viewer I am using is called Trace32. The batch file copies this down to the local system from a network location, then uses assoc and ftype commands to designate Trace32 to be the default viewing program. The problem comes in when the log file is opened. Trace32 opens up, however the log file is not displayed. In order to see the log file, one would have to then select open and select the log file to see it. The issue becomes a little more convoluted when I use windows to double-click on the very same file, and it opens up in Trace32 like I'm wanting it to do with the batch file. Any ideas as to what be causing this? I'd really like to minimize user interaction as much as possible, as I'm sure most of you are aware, the general user has a knack for messing things up when given the opportunity to do so. I have copied the pertinent PARTS of the batch file below (changing some locations too.) I can't do the whole thing because of proprietary network rules and regs, sorry.

assoc .log=logfile
xcopy c:\users\shaun\desktop\Startup\Trace32.exe c:\windows\system32\cmsetup /q /y>nul
ftype logfile=c:\windows\system32\cmsetup\Trace32.exe
start cmsetup.log

Any help would be greatly APPRECIATED. Thank you in advance.BTW, this is a Win 7 cmd prompt environment, for any of the subtle differences there may be between environments.If Trace32 has some dangerous features for users, maybe use notepad to open the log file if its not a formatting nightmare and ascii text. The worst a user can do with notepad is change the log file and save it.

I use to use START notepad.exe "error.log" for reporting errors to users.

So maybe you can just use START NOTEPAD.EXE "cmsetup.log" and send the user to the safety of the notepad environment vs Trace32's interface.Oddly enough, this ended up working when I used the full file path for the program to start and the log file to open.

start c:\windows\system32\cmsetup\Trace32.exe c:\windows\system32\cmsetup\cmsetup.log

On talking with a colleague I found out that unless the file and program are in the system path, the batch file will not be able to process the locations correctly. That is why I was running into the issue I found. Doing it this way also eliminates the need for the assoc and ftype commands, so it ended up saving some time and space.

Thanks.I know this is an old thread, but I came across this thread via search because I was having a similar problem.

For me, Trace32 was already set as the default .LOG file viewer and was previously displaying logs with no trouble. Then Trace32.exe got moved or deleted and the new copy would open but would not display any log data. I was opening the log files through the GUI by double-clicking the log file, so command line was not involved in my case. I could open log files in Notepad and see that there was data there, but Trace32 wouldn't display it.

What fixed my issue was opening Trace32, going to File > Open, UNCHECK the "Ignore existing lines" checkbox, and opening a log file. The first time Trace32 did the same thing and did not SHOW existing lines, but after closing Trace32 and re-opening by double-clicking a log file it opened correctly and displayed the existing lines.

I hope this will be helpful for someone else in the future as well. I found my answer in the "ConfigMgr2007Toolkit.chm" that is included with the Toolkit. My original copy of Trace32 was copied from a colleague and was *just* Trace32, not the whole toolkit.



Discussion

No Comment Found