Hi folks!
I'm writing a snippet of code to be a mass update to let folks know who is locking a record, and send a quick message to tell them to get out. However, it's not working. Code is below.
- the call of the IP works great
- the call of the User works great
- no matter what, I can't get the message to go through with @redirectprocess, or @shell, but the exact same line typed in a command prompt works -- why?
Thanks!
stat vIPLookup as string
stat vIP as string
stat vIPUser as string
stat vIPCommand as string
stat vIPMessage as string
stat vMessage as string
vIPLookup = @PromptForUserInput("Which IP To Look Up?","192.168.2.181")
vIPCommand = @RedirectProcess("nslookup " + vIPLookup,"")
vIPUser = @RedirectPRocess("wmic.exe /node:" + vIPLookup + " computersystem get username","")
@MsgBox(vIPLookup,vIPUser,"")
if @instr(vIPCommand,"ERROR") < 1
{
if @askuser("Message " + VIPUser + "?","","")
{
vIPMessage = @PromptForUserInput("Message?","")
if vIPMessage <> ""
{
vIPCommand = "msg /server:" + vIPLookup + " * " + @chr(34) + vIPMessage + @chr(34)
vIPCommand = @redirectprocess(vIPCommand,"")
// vIPCommand = @Shell(vIPCommand)
}
}
}