how to start a vbs script in a vbs script on a client computer
-
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
-
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
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 -
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 KreskowiakI 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...
-
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...
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 -
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 Kreskowiakokay, 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.
-
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.
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