Remote ShutDown With Timer And Comment
Im having a little problem with this one too
Server
VB Code:
If Left(incommingData, 9) = "shutdown " Then
Shell Split(incommingData)(0) & Split(incommingData)(1) & " -c " & Split(incommingData)(2)
End If
Client
VB Code:
Private Sub shutdowntimer_Click()
Dim Data11 As String
Data11 = "shutdown " & "-s -f -t " & txttimer.Text & txtcomment.Text
Winsock.SendData Data11
End Sub
When ever I try to start it, it says
Run-Time Error '53':
File not found
I had it working but I forgot to save when I closed it not I cant get it to work again someone help :) please
I think I know whats wrong it needs " at front and " at end but cant get them in
Re: Remote ShutDown With Timer And Comment
its not the " because if you try something like assuming the value of text1 is 'notepad' it will work.
whats the txttimer and txtcomment for?
the way it is coded above will make the client execute this...
lets say txttimer holds "myTimer" and txtcomment holds "myComment"
Code:
shutdown-s -c -fmyTimermyComment
Can you tell me exactly how you want the shell statement to be executed
Re: Remote ShutDown With Timer And Comment
for it to execute in cmd and do something like
shutdown -s -f -t 30 -c "Hello"
Re: Remote ShutDown With Timer And Comment
Quote:
Originally Posted by GoldenZero
for it to execute in cmd and do something like
shutdown -s -f -t 30 -c "Hello"
does the Hello have to have the " around it? or is it just
Code:
shutdown -s -f -t 30 -c Hello
Re: Remote ShutDown With Timer And Comment
well its a comment so yes, but I can have it in my text box
Re: Remote ShutDown With Timer And Comment
is the Hello comment actually part of the Shell statement or is it just for your msg?
Re: Remote ShutDown With Timer And Comment
its part of the shell
if you type shutdown in cmd you can see
Re: Remote ShutDown With Timer And Comment
client
VB Code:
Private Sub shutdowntimer_Click()
Dim Data11 As String
Data11 = "shutdown -s -f -t " & txttimer.Text & " " & Chr(34) & txtcomment.Text & Chr(34)
Winsock.SendData Data11
End Sub
server
VB Code:
If Left(incommingData, 9) = "shutdown " Then
Shell incommingData
End If
Re: Remote ShutDown With Timer And Comment
no man dont work :/ if outgoing data shutdown -s -f -t it needs to be shutdown -s -f -t incoming on server
Re: Remote ShutDown With Timer And Comment
the above code will make it shell this
Code:
shutdown -s -f -t 30 -c "Hello"
(including the " ")
Re: Remote ShutDown With Timer And Comment
is it the same error? are you sure shurdown is a valid command? i typed it in to cmd and says unrecognised
Re: Remote ShutDown With Timer And Comment
it compiles and everything but when I try to execute it the window just blinks :/
Re: Remote ShutDown With Timer And Comment
you have the syntax wrong you need to include the -c command if you want a message, do it like this
client
VB Code:
Private Sub shutdowntimer_Click()
Dim Data11 As String
Data11 = "shutdown -s -f -t " & txttimer.Text & " -c " & Chr(34) & txtcomment.Text & Chr(34)
Winsock.SendData Data11
End Sub
server
VB Code:
If Left(incommingData, 9) = "shutdown " Then
Shell incommingData
End If
Re: Remote ShutDown With Timer And Comment
Re: Remote ShutDown With Timer And Comment
Quote:
Originally Posted by GoldenZero
thanks man works A++ :)
kk:) please rate and mark the thread as resolved from the Thread Tools menu :thumb:
Re: Remote ShutDown With Timer And Comment
done and going to do it for other thread you helped me with :D