Well, from my previous post (regarding finding user names and resolving them to host and IP) I delve deeper into the maddness.
Code:
$=RedirectOutput("error.txt")
$nFndID=insert username here
$nView=WshPipe('net view')
If @ERROR Exit @ERROR EndIf
For Each $nCPU In $nView
Join(Split($nCPU,"\"),"") = $nHost
$nHost
$nUser=WshPipe('nbtstat -a' +$nHost+' ""',1)
If InStr($nUser, $nFndId)
$nfnd=Split($nUser, "")
For Each $aFnd In $nfnd
If InStr($nfnd, $nFndId)
blah, blah, blah...
I know, know...it's a meager start (very meager), but cut me some slack I'm a newbie(thank you very much). So here's what happens...I'm running a 'net view' from a cmd line and putting the output into $nView then I'm creating a variable on the fly called $nCPU (I know, OPTION EXPLICIT ON, but still). What I'm attempting after that is what has me stumpped. I'm trying to remove the "\\" from the front of the computer name and then call that $nHost so I can do an nbtstat -a on it, but it keeps failing. Here's what my error.txt file says...
[not code]
Server Name Remark
-------------------------------------------------------------------------------
\\ID6042
\\ID6495
The command completed successfully.
0
[/not code] couldn't resist---hehe
It's all that space I don't know what to do with, and the dashes, and why is $nHost = 0.
HELP OH GREAT ONES, FOR I'VE LOST MY WAY. Not really, I've just got no clue what I'm doing.
Thanks in advance.
_________________________
I don't know SH!$, so don't ask me questions and I won't have to lie to you.