I can beat that. Just make a shortcut and put this in the target field:
cmd.exe /K tail.exe "C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log"
It's a one liner so no need for a BATCH file.
If you did want a script file, then do this:
@echo off
tail.exe "C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log"
or just
@tail.exe "C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log"
since it's only 1 line.
I'm going to guess that the problem you had was that you named your BATCH file tail.bat
. Then inside it you just used tail C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log
. This caused your script to reference itself because DOS is going to look in the current dir first. It would've ended up calling tail.bat C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log
over and over again.
Update
If you want the window to stay open then you have a few options. You can use the pause
command:
@tail.exe "C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log"
@pause
or you can lauch a new shell inside the terminal which stays open after it finishes. This will cause the parent shell to remain open as well as the terminal itself:
@cmd.exe /K tail.exe "C:\Oracle\WebCenter\Sites\11gR1\Sites\11.1.1.6.1\logs\sites.log"
The pause
command is good if you want the window to close easily. Just press any key and it's gone. The second option is better if you typically want to run other commands after it runs.