Jump to content

Net Send


Recommended Posts

Greetings,

Need help on the progress bar for Net Send script that i did. Need the progress bar so that the user know that the program is still running and trying to send the message

Do
  $PC = InputBox("Message To", "Please Specify Name:")
  If @error == 1 Then Exit
Until $PC <> " "

Do
  $Text = InputBox("Message Text", "Enter your message.")
  If @error == 1 Then Exit
Until $Text <> " "

if RunWait(@comspec & " /c net send "& $PC &" "& $Text,"",@sw_hide) == 0 Then
 MsgBox(0, $PC,"Message Send")
Else
 MsgBox(0, $PC,"Cannot Send Message")
EndIf

Where should i insert the progress code ...

Thanks

Link to comment
Share on other sites

A progress bar doesn't really fit your situation. If you were doing net sends to a group of computers, you would divide 100 by the number of computers to get the increment amount. Then, after each net send, you would add the increment amount to the progress bar.

In your situation with a single net send, a progress bar doesn't work for two reasons. One, you're using RunWait to get the return code of the net command. This pauses your script until the net send is complete. Second, you're running a single command: how would you know how fast to increment the progress bar so it's at exactly 100% when the net send completes?

I'd recommend you use SplashTextOn with a "Net Send in Progress" type of message.

Jeff

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...