Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to start a vbs script in a vbs script on a client computer

how to start a vbs script in a vbs script on a client computer

Scheduled Pinned Locked Moved Visual Basic
linuxtoolshelptutorial
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11883281
    wrote on last edited by
    #1

    i now how it works with a user:

    set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.run "runas /user:'username' 'script.VBS'"
    WshShell.AppActivate ("runas.exe")

    but i want to put the clientcomputer instead of the user... can you help me

    D 1 Reply Last reply
    0
    • U User 11883281

      i now how it works with a user:

      set WshShell = WScript.CreateObject("WScript.Shell")
      WshShell.run "runas /user:'username' 'script.VBS'"
      WshShell.AppActivate ("runas.exe")

      but i want to put the clientcomputer instead of the user... can you help me

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You have to use WMI and the Win_Process class to start a process on a remote machine. Because of security risks, it can NOT be a user interactive process. The script you want to run must be on the remote machine so you will probably have to copy it over there first. Also, the person running your local script must have administrator permissions to the remote machine! win32_process remote process[^]

      A guide to posting questions on CodeProject

      Click this: Asking questions is a skill. Seriously, do it.
      Dave Kreskowiak

      U 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You have to use WMI and the Win_Process class to start a process on a remote machine. Because of security risks, it can NOT be a user interactive process. The script you want to run must be on the remote machine so you will probably have to copy it over there first. Also, the person running your local script must have administrator permissions to the remote machine! win32_process remote process[^]

        A guide to posting questions on CodeProject

        Click this: Asking questions is a skill. Seriously, do it.
        Dave Kreskowiak

        U Offline
        U Offline
        User 11883281
        wrote on last edited by
        #3

        I don't want to run it on a remote machine... i want to start a script on a server and this script should run the other script on a normal pc... which is used by a user... my problem is that when i run it on the user, my msgBox isn't shown anywhere, so I think i have to run it on the pc, isn't it right? sry if my first question wasn't clearly...

        D 1 Reply Last reply
        0
        • U User 11883281

          I don't want to run it on a remote machine... i want to start a script on a server and this script should run the other script on a normal pc... which is used by a user... my problem is that when i run it on the user, my msgBox isn't shown anywhere, so I think i have to run it on the pc, isn't it right? sry if my first question wasn't clearly...

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You're not describing this correctly at all. How many machines are involved. Give them names and use ONLY those names to refer to the machines. Do not use "user", use "Client" and "Server". Which machine is local and which is the remote machine?

          Member 11916735 wrote:

          i want to start a script on a server and this script should run the other script on a normal pc.

          OK. This describes a user logged into a server, running a script on it that will launch a script on a remote client machine. What am I missing?

          A guide to posting questions on CodeProject

          Click this: Asking questions is a skill. Seriously, do it.
          Dave Kreskowiak

          U 1 Reply Last reply
          0
          • D Dave Kreskowiak

            You're not describing this correctly at all. How many machines are involved. Give them names and use ONLY those names to refer to the machines. Do not use "user", use "Client" and "Server". Which machine is local and which is the remote machine?

            Member 11916735 wrote:

            i want to start a script on a server and this script should run the other script on a normal pc.

            OK. This describes a user logged into a server, running a script on it that will launch a script on a remote client machine. What am I missing?

            A guide to posting questions on CodeProject

            Click this: Asking questions is a skill. Seriously, do it.
            Dave Kreskowiak

            U Offline
            U Offline
            User 11883281
            wrote on last edited by
            #5

            okay, please let me explain again: I have one service running on the server (service is running as domain administrator). this service executes my script. this script should start another script on a client, wich prompts a msgbox for the currently logged in user. Due the service (and so also the script) is running as domain administrator, I hope I can use its permissions for the client, no matter wich user is logged in on the client. I hope everything is clearly for you now.

            D 1 Reply Last reply
            0
            • U User 11883281

              okay, please let me explain again: I have one service running on the server (service is running as domain administrator). this service executes my script. this script should start another script on a client, wich prompts a msgbox for the currently logged in user. Due the service (and so also the script) is running as domain administrator, I hope I can use its permissions for the client, no matter wich user is logged in on the client. I hope everything is clearly for you now.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              That's a LOT better! Too bad, it's never going to work. You can launch your process (script) on the remote machine. The problem is, because of security concerns, it's not allowed to put up any kind of user interface. The user on the machine will NEVER see the dialog box or anything that asks for input from the user on the remote machine. I think the security implications of code being launched on a users machine from an unknown remote server are quite obvious. There is no way to get around this. What's the purpose of this script running on the remote machine?

              A guide to posting questions on CodeProject

              Click this: Asking questions is a skill. Seriously, do it.
              Dave Kreskowiak

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups