I am trying to create a pop-up alert system inside Access using the Shell() command to execute a .CMD file. What I want is to be able to execute the .CMD file and pass it the computer name of the person I want the pop-up message to go to. I would also like to be able to pass the actual text of the pop-up message to the .CMD file. According to Access' help, you can pass arguments using the Shell() command, but I don't know the correct syntax. Also, what is the syntax to use inside of the .CMD file for receiving the passed arguments?
Here is the code I have behind the button that calls the Shell command:
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim stAppName As String
stAppName = "C:\message_test.cmd /USER=jpastika"
Call Shell(stAppName, 0)
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
***************************************
Here is what I have in my .CMD file:
net send %COMPNAME% %MESSAGE
****************************************
Any help or suggestions would be greatly appreciated! Thank you.
-Jeremy Pastika
Here is the code I have behind the button that calls the Shell command:
Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim stAppName As String
stAppName = "C:\message_test.cmd /USER=jpastika"
Call Shell(stAppName, 0)
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
***************************************
Here is what I have in my .CMD file:
net send %COMPNAME% %MESSAGE
****************************************
Any help or suggestions would be greatly appreciated! Thank you.
-Jeremy Pastika