Well did some rework using the UDF DBCommand () that Jens wrote, I have it returning all the values I want. Now, my only problem, is getting the mapping working. Here is my code so far:

code:
$ConnDSN="DRIVER=SQL Server;SERVER=$Server;UID=$User;PWD=$Password;DATABASE=hfnetchk"
$sql="SELECT Location, IP1, NTUser, NTPassword from Contact WHERE Location='PAT'"
$recordset = DBCommand($ConnDSN,$sql)

$NULL=REDIRECTOUTPUT("c:\array.txt",0)
for $row=0 to ubound($recordset,1)
USE "\\'RTRIM($recordset[$row,1])'\IPC$" /user:'RTRIM($recordset[$row,2])' /password:'RTRIM($recordset[$row,3])'
? "\\"+RTRIM($recordset[$row,1])+"\IPC$ /user:"+RTRIM($recordset[$row,2])+" /password:"+RTRIM($recordset[$row,3])
next
$NULL=REDIRECTOUTPUT("")

I use the REDIRECT so I can see the "expected" output, and it looks perfect. But I cannot seem to get the syntax correct for either a USE command or a SHELL 'net use...' command. I have tried various ways to try and write it up. Always get the literal "RTRIM($recordset[$row,3])" passed in the statement.

Anyone have an idea of how to take the variables and input them into a mapping that works?

Thanks!
Shawn