Results 1 to 16 of 16

Thread: Remote ShutDown With Timer And Comment

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    Exclamation Remote ShutDown With Timer And Comment

    Im having a little problem with this one too


    Server
    VB Code:
    1. If Left(incommingData, 9) = "shutdown " Then
    2.     Shell Split(incommingData)(0) & Split(incommingData)(1) & " -c " & Split(incommingData)(2)
    3. End If

    Client
    VB Code:
    1. Private Sub shutdowntimer_Click()
    2. Dim Data11 As String
    3. Data11 = "shutdown " & "-s -f -t " & txttimer.Text & txtcomment.Text
    4. Winsock.SendData Data11
    5. 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.

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Remote ShutDown With Timer And Comment

    its not the " because if you try something like
    VB Code:
    1. Shell text1.text
    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
    Chris

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    Re: Remote ShutDown With Timer And Comment

    for it to execute in cmd and do something like

    shutdown -s -f -t 30 -c "Hello"

  4. #4
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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
    Chris

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    Re: Remote ShutDown With Timer And Comment

    well its a comment so yes, but I can have it in my text box

  6. #6
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Remote ShutDown With Timer And Comment

    is the Hello comment actually part of the Shell statement or is it just for your msg?
    Chris

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    Re: Remote ShutDown With Timer And Comment

    its part of the shell

    if you type shutdown in cmd you can see

  8. #8
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Remote ShutDown With Timer And Comment

    client
    VB Code:
    1. Private Sub shutdowntimer_Click()
    2. Dim Data11 As String
    3. Data11 = "shutdown -s -f -t " & txttimer.Text & " " & Chr(34) & txtcomment.Text & Chr(34)
    4. Winsock.SendData Data11
    5. End Sub
    server
    VB Code:
    1. If Left(incommingData, 9) = "shutdown " Then
    2.     Shell incommingData
    3. End If
    Chris

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    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

  10. #10
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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 " ")
    Chris

  11. #11
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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
    Chris

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    Re: Remote ShutDown With Timer And Comment

    it compiles and everything but when I try to execute it the window just blinks :/

  13. #13
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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:
    1. Private Sub shutdowntimer_Click()
    2. Dim Data11 As String
    3. Data11 = "shutdown -s -f -t " & txttimer.Text & " -c " & Chr(34) & txtcomment.Text & Chr(34)
    4. Winsock.SendData Data11
    5. End Sub
    server
    VB Code:
    1. If Left(incommingData, 9) = "shutdown " Then
    2.     Shell incommingData
    3. End If
    Chris

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    Re: Remote ShutDown With Timer And Comment

    thanks man works A++

  15. #15
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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
    Chris

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Location
    New Brunswick, Canada
    Posts
    30

    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
  •  



Click Here to Expand Forum to Full Width