net send - cmd.exe fails to initialize

R

roisin

Hi all,

Am trying to run a message service using net send via our intranet -
basically the user selects the poeple on the network who they want to
send a message to from a drop-down list on a form and on submit a loop
is run - here's a snippet of the code (inside a for loop)

<% elseif Request.Form("recipients")(a) <> "" then %>
<% NamUsr = CStr(Request.Form("recipients")(a)) %>
<% server_shell.Run "%comspec% /c net send " & NamUsr & " FROM " &
username &":" & Msg %>

(Note : I create the server_shell object outside the loop and set it
to nothing when the loop has finished - also username is basically
Server Variable Logon User)

The problem happens when all users are selected - it sends it to a few
people and then bombs out and then i get a load of application errors
- cmd.exe or net.exe failed to initialize on the server.

yet when tested for smaller numbers of users it runs fine - any ideas?

TIA
grif
 
M

Mark Schupp

Probably because you are spawning so many copies of cmd.exe. Try write out a
..bat file with all of the net send commands in it. Then run the batch file
so that only one instance of cmd.exe has to be created.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top