Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
BangersInMyKnickers
Nov 3, 2004

I have a thing for courageous dongles

Alright, really dumb and most likely easy HTML question, but I don't know much of any html and our web guy doesn't know how to do this off the top of his head:

I need an easy web submission form for service requests, and we have everything flushed out except I want some of the text boxes to contain that grey, italic text that goes away when cursor focus is brought to the box or something is typed in to it. I have no idea what this element property is called though, and googling a general description of it turns up a mess of garbage. Can someone point me in the right direction or give me some quick example code to give to my web guy?

Adbot
ADBOT LOVES YOU

BangersInMyKnickers
Nov 3, 2004

I have a thing for courageous dongles

VBScript question:

I have our domain workstations execute a batch script that checks a log file for the set date of the local admin password and then invokes a .vbe script if it needs to be changed. It looks something like this:

code:
'Encoded VBScript to change Administrator password
'**Start Encode**
strComputer = "."
strAdminUsername = "Administrator"
Set objUser = GetObject("WinNT://" & strComputer & "/" & strAdminUsername)
objUser.SetPassword "P4ssW0rd"
One of the weaknesses here is that the batch script passes the work off to the VBScript and just assumes everything works correctly. I would like to use the Wscript.Quit method to return 0 upon successful completion and 1 if an error is encountered, but I don't really know what the hell I am doing in VB and am just hacking bits together. Any ideas?

BangersInMyKnickers
Nov 3, 2004

I have a thing for courageous dongles

Management had me hobble together a scheduled task that runs overnight on systems to generate a log so we can keep track of those who aren't turning things off at night. Basically there is a network share and the each system appends to a text file bearing the system name in that share adding a line "%date% %time% %status%" (where status is the username if logged on or simply 'loggedoff' if there is no console session). Output ends up looking like this:

code:
Thu 07/16/2009 04:00:00.53      [DOMAIN]\[USERNAME]
Fri 07/17/2009 04:00:00.53      [DOMAIN]\[USERNAME]
Sat 07/18/2009 04:00:00.53      loggedoff
Sun 07/19/2009 04:00:00.53      loggedoff
Then I have my own script that pulls a directory listing and loops through each file checking for the day codes and setting a variable if found, which at the end dumps the data in to a single CSV document which I can import easily in to Excel and hand off the management.

Looks like this:
code:
[SYSTEM1],O,O,,,,, 
[SYSTEM2],L,L,,,,, 
[SYSTEM3],L,L,,,,, 
[SYSTEM4],O,O,,,,,
Due to the limitations of the FIND and FINDSTR commands returning the whole line a pattern match was found on, I can only search for "[DOMAIN]\*" and set a value to O(on, logged off) or L (logged on) depending on the returned errorlevel. Is there some command line search trickery I can use to filter down the results of the "[DOMAIN]\*" to show only the matching pattern and not the entire line it is on so I can dump that in to a variable to pass to the CSV data? Is there a Windows FIND or FINDSTR replacement that can give me this kind of functionality? Is there a better way to go about this than what I am doing, bearing in mind that I have to keep this garbage in a command-line script for future workers?

BangersInMyKnickers
Nov 3, 2004

I have a thing for courageous dongles

Jethro posted:

Give For /F a shot in conjunction with FINDSTR.

http://www.robvanderwoude.com/ntfortokens.php

Great! I've only used for loops for increment counting and recursive list execution, you finally got me to sit down and figure out the delimiter functionality and this works perfectly.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply