Login | |
|
 |
RE: Execute a file on remote pc - 5/22/2008 7:32:46 AM
|
|
 |
|
| |
dm_4ever
Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
wshShell.Run "cmd /c \\" & strComputer & "\c$\defragall.exe" or wshShell.Run "\\" & strComputer & "\c$\defragall.exe" Oh, and this only executes on the machine running this script.
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Execute a file on remote pc - 5/22/2008 9:39:31 AM
|
|
 |
|
| |
dm_4ever
Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
You can use WMI and Win32_Process class, or psexec.exe (from microsoft), or create a scheduled task via WMI or schtasks (on winxp or better), and there's a few more...how many machines are you looking at?
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Execute a file on remote pc - 5/22/2008 9:57:25 AM
|
|
 |
|
| |
dm_4ever
Posts: 2665
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
If defragall.exe is already on the C: drive of the 50 or so machines it would be something like WshShell.Run "C:\scripts\psexec.exe \\" & strComputer & " C:\defragall.exe" If the executable is not on the workstations...copy it over with PSExec if it is small enough strSource = "\\server\share\defragall.exe" WshShell.Run "C:\scripts\psexec.exe \\" & strComputer & " -c " & strSource
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Execute a file on remote pc - 7/6/2008 11:01:44 PM
|
|
 |
|
| |
mbouchard
Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
You can pass the username/password for the remote PC via your psexec commandline (-u and -p). Take a look at the help file for specific syntax.
_____________________________
Mike For useful Scripting links see the Read Me First stickey! Always remember Search is your friend.
|
|
| |
|
|
|
|
|