|
-
Feb 28th, 2006, 08:33 PM
#1
Thread Starter
Junior Member
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
Last edited by GoldenZero; Feb 28th, 2006 at 09:16 PM.
-
Mar 1st, 2006, 09:31 PM
#2
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
-
Mar 1st, 2006, 09:33 PM
#3
Thread Starter
Junior Member
Re: Remote ShutDown With Timer And Comment
for it to execute in cmd and do something like
shutdown -s -f -t 30 -c "Hello"
-
Mar 1st, 2006, 09:40 PM
#4
Re: Remote ShutDown With Timer And Comment
 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
-
Mar 1st, 2006, 09:41 PM
#5
Thread Starter
Junior Member
Re: Remote ShutDown With Timer And Comment
well its a comment so yes, but I can have it in my text box
-
Mar 1st, 2006, 09:43 PM
#6
Re: Remote ShutDown With Timer And Comment
is the Hello comment actually part of the Shell statement or is it just for your msg?
-
Mar 1st, 2006, 09:45 PM
#7
Thread Starter
Junior Member
Re: Remote ShutDown With Timer And Comment
its part of the shell
if you type shutdown in cmd you can see
-
Mar 1st, 2006, 09:51 PM
#8
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
-
Mar 1st, 2006, 09:54 PM
#9
Thread Starter
Junior Member
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
-
Mar 1st, 2006, 09:54 PM
#10
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 " ")
-
Mar 1st, 2006, 09:57 PM
#11
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
-
Mar 1st, 2006, 09:58 PM
#12
Thread Starter
Junior Member
Re: Remote ShutDown With Timer And Comment
it compiles and everything but when I try to execute it the window just blinks :/
-
Mar 1st, 2006, 10:02 PM
#13
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
-
Mar 1st, 2006, 10:04 PM
#14
Thread Starter
Junior Member
Re: Remote ShutDown With Timer And Comment
thanks man works A++
-
Mar 1st, 2006, 10:05 PM
#15
Re: Remote ShutDown With Timer And Comment
 Originally Posted by GoldenZero
thanks man works A++ 
kk please rate and mark the thread as resolved from the Thread Tools menu
-
Mar 1st, 2006, 10:08 PM
#16
Thread Starter
Junior Member
Re: Remote ShutDown With Timer And Comment
done and going to do it for other thread you helped me with
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|