Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1560
  • Last Modified:

VBSCRIPT - net send?

Hi
Im using Win 2K Pro (not sure if that matters) but I try to do this in a .vbs file and it seems to open a command prompt real quick and then not do a netsend at all.

If I do
cmd
net send pc024 test
I do get a message

But not with my code below.

Set objShell = Wscript.CreateObject("WScript.Shell")
Comp2Reach = pc024
Message2Send = "test"
objShell.Run "net send " & Comp2Reach & " " & Message2Send

Thank!
0
hmcgeehan
Asked:
hmcgeehan
1 Solution
 
Lee SavidgeCommented:
Hi,

Doesn't this:

Comp2Reach = pc024

need to be this:

Comp2Reach = "pc024"

I am guessing that the Comp2Reach is a string?

Regards,

Lee
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now