Topics - Rover [ switch to compact view ]

Pages: prev1 2 3 4 5 6 [7] 8 9 10 11next
31
Living Room / June 4 Podcast
« on: June 04, 2006, 09:50 PM »
Just finished listening and didn't see an existing topic.

That was fun.  Superboyac's rants/ramblings are entertaining.  The forum nickname origins were fun too.  Overall it was fun to listen to.  I like the programming blues tune too, although I had a hard time hearing it.

I always want to go record a snippet for the next show, but I don't have a mic installed on my system.  The mic I have is way down it the basement, and that would mean leaving my PC.  :o 

One of these days....

32
Alright AHK fans, I tried, I really did.  I used Autoit 2.0 for automating some stuff a few years ago.  When I saw some of the cool things going on around DC with AHK, I thought I'd try to solve my little problem using it.
I am now going to have to rewrite it, in something a little more .... reliable, documented, debuggable!

All I wanted to do was parse a few strings, do some case statements and exec a couple of apps with parameters. 

Here is the actual, psudocode spec: 

Execute ipconfig | find "IP Address" > c:\ipaddr.txt
Execute %cmdspec$ /c type c:\zenworks\smbiosdump.log | find "Serial Numer" > c:\serno.txt

Read the first line of c:\ipaddr.txt  (IP Address .......... :  10.91.185.20)
Extract the 3'rd octet (185 in this case)

Read the first line of c:\serno.txt   (Serial Number:               'BX43299')
Extract the Serial Number (sans single quotes)

Based on the ip address 3'rd octet, assign a 3 letter building code
IP 182 -185 Code = MSW
IP 187 -189 Code = MSS
etc.

Use the Code and IP to create a unique PC name:
PCNAME=MSW-BX43299

Using that name execute a few commands
exec c:\program files\zenworks\zwsreg -unreg
exec c:\program files\zenworks\zwsreg -workstation PCNAME
exec c:\windows\system32\wsname.exe /N:PCNAME
exec c:\windows\system32\ipconfig /registerdns


THAT'S IT.  No Earth shattering discoveries here.  I will paste my final attempt at AHK for you review.  You can correct my thinking, etc.  I have moved on.  For the record, this is the butchered version that I was debugging with.  I finally gave up on trying to exec the first 2 commands from within AHK and created a 2 line .cmd file to deal with it.  The Run/Runwait commands WOULD NOT execute these statements.  Grrr...

Here's the ugly code
FileReadLine, ipline, C:\ipaddr.txt, 1
FileReadLine, sernoline, C:\SerNo.txt, 1

; I don't think any of this part works. 
; Stupid ass way to run functions... what's wrong with ipaddr := stringtrimleft, ipaddr, pos

colon := ":"
StringGetPos, pos, ipline, %colon% ; started as IP Address ....: 10.91.10.20
StringTrimLeft,ipaddr,ipline,%pos% ; should leave 10.91.10.20

StringGetPos, pos, ipaddr, .   ; should find the first .
StringTrimLeft,ipline,ipaddr,%pos% ; and leave 91.10.20
StringTrimLeft,ipaddr, ipline, 1

StringGetPos, pos, ipaddr, .   
StringTrimLeft,ipline,ipaddr,pos   ; leaving 10.20
StringTrimLeft,ipaddr,ipline,1

StringGetPos, pos, ipaddr, .   ; find the .
StringLeft,ipline,ipaddr,%pos%     ; copy from left ... 10.
StringLeft,ipaddr,ipline,1
StringTrimRight,locationkey,ipaddr,1  ; kill the . leaving 10 in locatinkey

location := "none"
if locationkey between 213 and 215 location := "mse"
if locationkey between 217 and 219 location := "mss"
if locationkey between 209 and 211 location := "msw"
if locationkey between 233 and 235 location := "bes"
if locationkey between 221 and 223 location := "ges"
if locationkey between 229 and 231 location := "hes"
if locationkey between 225 and 227 location := "jes"
if locationkey between 237 and 239 location := "res"
if locationkey between 181 and 183 location := "les"
if location = "none" location := "lhs".

; can't get the damn thing to trim the crap before the  first '

StringGetPos, pos, sernoline, '
StringTrimLeft, serno, sernoline, %pos%
StringTrimRight, sernol, serno, 1
StringTrimLeft, serno, sernol, 1

sernolen := strlen(serno)
if (sernolen < 5) {
msgbox "Invalid Serial Number"
exit 1
}

wsname := location . "-" . serno
; insert high quality debugging device
msgbox %wsname%
runwait, c:\program files\novell\zenworks\zwsreg.exe -unreg, ,hide
runwait, c:\program files\novell\zenworks\zwsreg.exe -workstation %wsname%, ,hide
runwait, c:\windows\system32\wsname.exe /N:%wsname%, ,hide
runwait, c:\windows\system32\ipconfig /registerdns, ,hide




 :down: :down: :down: Boo.

33
Developer's Corner / MOANTS Database Design
« on: May 13, 2006, 09:44 PM »
For those not familiar, Superboyac started a big "to-do" with his discussion on Note-Taking software. See the link: https://www.donationcoder.com/forum/index.php?topic=2362.0

So I'm ready to start discussion database engines and database designs and this is where we'll do it.  Fire up your brains... it's time to work.   :Thmbsup:

34
General Software Discussion / Tons of Windows Tweaks/Tools
« on: May 09, 2006, 04:31 PM »
When I searched DC, I only found one little mention of this site and it was just a partial reference.  In any event, this is a pretty decent site for finding quick little reg-hacks, etc.  I found it, again, while looking for a way to change a computername from the command line.

http://www.kellys-korner-xp.com/xp_tweaks.htm

Over 300 registry tweaks on this page.  :Thmbsup:
 

35
Living Room / Days online --- seems odd
« on: May 05, 2006, 09:18 PM »
I've always been a little curious at how you calculate the "Days online" as seen below.  Given that DC is just over a year old and I've seen days in the 400's for a while... I'm confused  :P


Pages: prev1 2 3 4 5 6 [7] 8 9 10 11next
Go to full version