Mark Minasi's Reader Forum
Mark Minasi's Reader Forum
Home | Profile | Register | Active Topics | Active Polls | Members | Search | FAQ | Minasi Forum RSS Feed
 All Forums
 General Forum
 Miscellany (Technical)
 Weird hidden Notepad feature: Create a log file

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Note: please do not cross-post.
Cross-postings will be deleted and ignored.
Thanks for helping to keep this forum junk-free!
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
byoshino Posted - 07/12/2006 : 9:30:00 PM
I've never seen this one before...

http://www.downloadsquad.com/2006/07/07/weird-hidden-notepad-feature-create-a-log-file/

or the MS KB article:

http://support.microsoft.com/?kbid=260563
27   L A T E S T    R E P L I E S    (Newest First)
sixdoubleo Posted - 02/25/2008 : 3:49:13 PM
Tim, I slapped something together and created a thread in scripting to discuss this.

http://web2.minasi.com/forum/topic.asp?TOPIC_ID=25917
sixdoubleo Posted - 02/25/2008 : 2:26:54 PM
Yeah, I got'cha Tim. Sort of a "Why in the hell are you logging into this server interactively when I constantly harp on you idiots about using proper console and admin tools!!" dialog. I like it :)

Reminds me of our shop. For the longest they were in to using community admin ID's. One account for 7 people...with the same password for years. Well, when I setup AD, I assigned every admin their own account. But we had to keep a "community" account for specific purposes. While everybody has adjusted well to having separate admin ID's, two of our staff still insist on using the community account. So I finally put a check in the login script that if that user logged in, it would throw up 10 consecutive system modal dialog boxes (meaning no getting around them) reminding them that use of that ID is discouraged....each with a different wording...each requiring them to click OK.

Anyway...yeah....I would just ditch the notepad ".LOG" trick at that point and write something. Just a VBScript or something else that throws up an input box asking for a reason for your login. If you hit cancel, it simply logs date time, user, server, ip, etc. If you click OK, it logs the reason along with that stuff. It would be super simple, but the only limitation I can think of is that VBScript doesn't have a memo style input box...just a one-line input. Or a somewhat more crude method would be to just have VBScript spit the date, time, user, server, ip into the file, then launch the file with notepad so you can provide a reason.

Hope we're not getting off-topic.
JSCLMEDAVE Posted - 02/25/2008 : 1:53:26 PM
Ok I have to apologize for not being clear.

The shortcuts already exist in the All User Desktop; so no matter who logs in they can have access to the existing shortcut.

All of the shortcuts are pointing to \\Servername\Share\HistoryFile.txt

The HistoryFile.txt file has the .LOG on the first line which adds the Date Stamp each time it’s opened.

1:53 PM 2/7/2008

12:39 PM 2/25/2008

Etc ect…

What I was wondering was, if there was a way to tweak each existing shortcut (or the .LOG txt file itself) on each servers desktop, to pass the local info when you opened the short cut?

1:53 PM 2/7/2008
Tbolton ServerB


12:39 PM 2/25/2008
Tbolton ServerA

Upon reading your answer I think it would be better to have a VBS script on each desktop that would append the file with a popup text window.

So – forgive me I am not a programmer – something like –

echo %date% %time% %username% %computername% “message here” >> \\Server\Share\HistoryFile.txt

Only in VBS. Then I could place that script onto all the Server Desktops.

This is so that when I – or anyone else for that matter – sits down in front of a server to perform maintenance or update a file or app etc. There is some sort of record for documentation purposes.

This is something that I use for myself more then anything else. How many times have you tried to remember what it was you were testing or looking at from three months ago on a particular server?

Of course if you don’t use it, it’s not going to be of any value…

I would almost explain it as being like the window that prompts you during a Restart, only this would be when sitting down at the server to make a change or update.
Xenophane Posted - 02/25/2008 : 1:18:21 PM
Damn beating to the punch again
sixdoubleo Posted - 02/25/2008 : 1:10:49 PM
quote:
Originally posted by JSCLMEDAVE

Is there a way to place a shortcut on each servers desktop and tweak the shortcut to enumerate the userid and server name?

Something along the lines of echo %username, %computername% ?

So that along with the automated date stamp I could see the above.

i.e.

11:18 AM 2/25/2008
tbolton Server1A

Then if I wanted to look for a certain server, it would just be a search in the single .txt file.



Just do a logon script that echos the info into the text file.

echo %date% %time% : %username% - Logged on >> %ALLUSERSPROFILE%\Desktop\ServerActivity.txt

EDIT:

Duh...you said single text file. Yeah, just modify the above to point to a central log file. This is what I do on our network actually.

As far as dropping a shortcut on the desktop, depends on whether you are doing a DOS or VBScript logon script. If DOS, use SHORTCUT.EXE from the NTRESKIT. Works great.

If VBScript,



Dim objLink, strLink
   strLink = objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\Server Acitivty Log.lnk"
   Set objLink = objShell.CreateShortcut(strLink)
   objLink.TargetPath = "\\SomeServer\Admin\Logs\ServerActivity.log"
   objLink.Description = "Server Acitivty Log"
   objLink.IconLocation = "%SystemRoot%\system32\SHELL32.dll, 103"
   objLink.Save
JSCLMEDAVE Posted - 02/25/2008 : 12:29:01 PM
Is there a way to place a shortcut on each servers desktop and tweak the shortcut to enumerate the userid and server name?

Something along the lines of echo %username, %computername% ?

So that along with the automated date stamp I could see the above.

i.e.

11:18 AM 2/25/2008
tbolton Server1A

Then if I wanted to look for a certain server, it would just be a search in the single .txt file.
Mark Minasi Posted - 07/22/2006 : 08:14:48 AM
Is BGINfo great, or what? Clever lads, those Sysinternals guys.
danf Posted - 07/22/2006 : 02:15:15 AM
That Rocks! On each server we put a shortcut to the same .txt in the "all users" startup folder and set the shortcut to start minimized. I've been using "F5" to do a time stamp for each new log entry.

As well, we put BGInfo on each server, it sets the wallpaper (at login) to a set of predefined info., from system info, file versions even registry keys.
Lisa Posted - 07/21/2006 : 5:26:58 PM
Thank you, Mark.
Mark Minasi Posted - 07/21/2006 : 1:50:49 PM
Done, Lisa.
Lisa Posted - 07/20/2006 : 12:44:07 PM
Mark,

How about putting a sticky in this (Misc) category to list all of those "features" that everyone else thinks that everyone else knows about?

Example: I just recently found out about using Clip Board to paste Events in Word or Wordpad or Notepad from Event Viewer. Talk about a time saver! Someone showed it to me and I would have never noticed that button if it hadn't been pointed out. Probably all of you guys already know about it, but for me - WOW! I was excited. Before learning about Clipboard, I was using screen shots.
Lisa Posted - 07/20/2006 : 12:28:12 PM
At my new job, they use this exact thing on the servers. Not knowing it was a Notepad "feature", I thought someone created a script for it. Who knew Notepad had any features!
clarinathan Posted - 07/14/2006 : 5:15:22 PM
Indeed it works.
That is pretty cool, didn't know that!
joe_elway Posted - 07/14/2006 : 11:19:33 AM
quote:
Originally posted by MarkMinasi

Worked for me, Aidan. Try this:

1) Open Notepad.
2) On the first line, type ".LOG" without the quotes but WITH the uppercase. I did not press Return.
3) Save as mytestlog.txt
4) Close Notepad.
5) Doubleclick on mytestlog.txt wherever you put it.
You will see a timestamp in the file.



That did the trick Mark. That's a simple but handy function. And there I've been, typing that stuff by hand like an idiot for the last 10 years.
wobble_wobble Posted - 07/14/2006 : 10:18:11 AM
Sheer brilliance. Better than my excel sheets on a USB.

Mark Minasi Posted - 07/14/2006 : 09:14:40 AM
Worked for me, Aidan. Try this:

1) Open Notepad.
2) On the first line, type ".LOG" without the quotes but WITH the uppercase. I did not press Return.
3) Save as mytestlog.txt
4) Close Notepad.
5) Doubleclick on mytestlog.txt wherever you put it.
You will see a timestamp in the file.
joe_elway Posted - 07/14/2006 : 01:49:39 AM
Doesn't work for me. XP 64 sp 2.
Doug G Posted - 07/14/2006 : 12:15:33 AM
By the way, this feature is documented in the Notepad online help.
OscarVogel Posted - 07/13/2006 : 09:54:41 AM
I had heard that Doogie Howser M.D. used that .LOG feature in the epilogue of every show. You know, at the end when he sits down at his computer and sums up the moral of the story.

MorQ Posted - 07/13/2006 : 09:38:39 AM
Oops, it works for me now if I use .log as the extension. I did not read that so just used .txt.
JSCLMEDAVE Posted - 07/13/2006 : 09:34:17 AM
Works here... Thanks Bryan!

I am following Anthony's lead and am putting this on each server. Great idea!
netmarcos Posted - 07/13/2006 : 09:28:51 AM
Works fine over here on XP SP2
MorQ Posted - 07/13/2006 : 09:00:41 AM
I have WinXP, used capitals and hit enter after the .LOG and I can not get it to work. Any thoughts, he asked humbly?
jaxdave Posted - 07/13/2006 : 07:12:08 AM
news to me. thanks for the tip!
kgbrisc1 Posted - 07/13/2006 : 04:38:24 AM
Make sure the .log is in capitals though - took a few goes to figure that out
arek73 Posted - 07/12/2006 : 11:23:20 PM
It's true that we learn something new every day. Thanks for the tip!
anthony Posted - 07/12/2006 : 9:45:08 PM
I have been using this feature for years. It's wierd, how something that seems like everyone would know about, is a huge secret. It is another reason why this forum is great, and an even better reason to post things that you think are helpful. No matter how trivial they seem. I showed that feature to my assistant one day and he freaked.

My favorite use for this functionality is this:

I keep a text file on the desktop of each server I manage. Each time a logon and make a change to the server, I open the file and input what I did. It's an easy way to keep a record of the changes you make to your server.

Great post byoshino!

Mark Minasi's Reader Forum © 2002-2011 Mark Minasi Go To Top Of Page
This page was generated in 0.22 seconds. Snitz Forums 2000