Re: Run a .vbs on a remote PC
- From: "Mary" <Mary@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 16 Apr 2005 07:49:02 -0700
Peter I don't really understand...I had thought that it would run as a hidden
process, like I tested it with notepad.exe and that runs as a process in
taskmgr but it doesn't open up or anything so the user will have no idea that
its running, I wanted the same with my program. What my program does is that
it writes to a file a list of software installed on the PC, so I thought that
if I copied the file to the remote PC and then used the
objWMIService.Create("c:\scripts\MyProgram.vbs", null, null,intProcessID)
command then it would kick it of and create the output file with the results.
There are no prompts or no UI that the remote user would see so there
wouldn't be any user interaction??
"Peter Falz" wrote:
> Hi Mary,
>
> a process, which will be start on a remote system,
> can not AFAIK interact with the user. This process
> runs only in the background.
>
> Take a look at:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/create_method_in_class_win32_process.asp
>
> Older OS-Version are possible to do so.
>
> Bye
> Peter
>
>
>
>
> "Mary" <Mary@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag news:3B45E1EC-D7F5-458D-833D-E827A596152E@xxxxxxxxxxxxxxxx
> > Hi,
> >
> >
> >
> > I'm new to VBscript and trying to get MyProgram.vbs(which lists all software
> > installed on a PC) to run on a remote PC but it wont do anything....the
> > program runs fine on my local machine,and it runs fine on the remote PC if I
> > run it from there, but it wont work when I try remotely, any help would be
> > much appreciated...here's the code I have for running a remote program:
> >
> >
> > '==========================
> > 'Remote.vbs
> > '==========================
> >
> > Const OverwriteExisting = TRUE
> >
> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> > objFSO.CopyFile "C:\Scripts\MyProgram.vbs", _
> > "\\remoteIPAddress\C$\Scripts\",OverWriteExisting
> >
> > strComputer = "remoteIPAddress"
> >
> > Set objWMIService = GetObject("winmgmts:\\" & strComputer &
> > "\root\cimv2:Win32_Process")
> >
> >
> >
> > Error = objWMIService.Create("c:\scripts\MyProgram.vbs", null,
> > null,intProcessID)
> >
> > If Error = 0 Then
> > MsgBox (strProcess & " was started with a process ID of " & intProcessID &
> > ".")
> >
> > Else
> > MsgBox (strProcess & " could not be started due to error " & _
> > errReturn & ".")
> >
> > End If
> >
> > ================================= So it does copy the program to c:\Scripts
> > of the remote PC but it wont run the program...I do believe that it kicks of
> > a wscript process in the process list on task manager. Please help
>
>
>
.
- References:
- Run a .vbs on a remote PC
- From: Mary
- Re: Run a .vbs on a remote PC
- From: Peter Falz
- Run a .vbs on a remote PC
- Prev by Date: Re: Run a .vbs on a remote PC
- Next by Date: Re: Run a .vbs on a remote PC
- Previous by thread: Re: Run a .vbs on a remote PC
- Next by thread: Re: Run a .vbs on a remote PC
- Index(es):
Relevant Pages
|