psexec help

  • Thread starter Thread starter pete0085
  • Start date Start date
P

pete0085

Guest
I haven't used this in a while and can't figure out what I am doing wrong. I
am trying to execute a vbs script that will copy files to another pc. The
script works fine run by itself, but psexec is giving me an error of "system
cannot find the file specified". I'm sure it's a real basic thing, can
someone tell me what is wrong??

psexec \\mw_pc20 -u DOMAIN\administrator -p password
\\mw_pc21\sharedfolder\file.vbs

The pc20 is the target pc and the pc21 is mine in this example. I took
notes before but apparently I'm missing something.
 
Re: psexec help


"pete0085" <pete0085@discussions.microsoft.com> wrote in message
news:0525505B-695A-462E-B642-BA1E241B4BEF@microsoft.com...
>I haven't used this in a while and can't figure out what I am doing wrong.
>I
> am trying to execute a vbs script that will copy files to another pc. The
> script works fine run by itself, but psexec is giving me an error of
> "system
> cannot find the file specified". I'm sure it's a real basic thing, can
> someone tell me what is wrong??
>
> psexec \\mw_pc20 -u DOMAIN\administrator -p password
> \\mw_pc21\sharedfolder\file.vbs
>
> The pc20 is the target pc and the pc21 is mine in this example. I took
> notes before but apparently I'm missing something.


When you execute a .VBS file directly then you rely on two things:
- That the system knows what to associate VBS files with
- That the system defaults to cscript.exe (which it usually does not).

It is much safer to execute VB Scripts like so:

cscript.exe //nologo file.vbs
 
Re: psexec help

I need to be able to do this remotely. I have done this before with a msi
package, but it's not working the same.

"Pegasus (MVP)" wrote:

>
> "pete0085" <pete0085@discussions.microsoft.com> wrote in message
> news:0525505B-695A-462E-B642-BA1E241B4BEF@microsoft.com...
> >I haven't used this in a while and can't figure out what I am doing wrong.
> >I
> > am trying to execute a vbs script that will copy files to another pc. The
> > script works fine run by itself, but psexec is giving me an error of
> > "system
> > cannot find the file specified". I'm sure it's a real basic thing, can
> > someone tell me what is wrong??
> >
> > psexec \\mw_pc20 -u DOMAIN\administrator -p password
> > \\mw_pc21\sharedfolder\file.vbs
> >
> > The pc20 is the target pc and the pc21 is mine in this example. I took
> > notes before but apparently I'm missing something.

>
> When you execute a .VBS file directly then you rely on two things:
> - That the system knows what to associate VBS files with
> - That the system defaults to cscript.exe (which it usually does not).
>
> It is much safer to execute VB Scripts like so:
>
> cscript.exe //nologo file.vbs
>
>
>
 
Re: psexec help

Place the usual psexec.exe command in front of "cscript.exe"!


"pete0085" <pete0085@discussions.microsoft.com> wrote in message
news:53A3DC3A-DE7B-406E-9C2C-8B01DF126ABD@microsoft.com...
>I need to be able to do this remotely. I have done this before with a msi
> package, but it's not working the same.
>
> "Pegasus (MVP)" wrote:
>
>>
>> "pete0085" <pete0085@discussions.microsoft.com> wrote in message
>> news:0525505B-695A-462E-B642-BA1E241B4BEF@microsoft.com...
>> >I haven't used this in a while and can't figure out what I am doing
>> >wrong.
>> >I
>> > am trying to execute a vbs script that will copy files to another pc.
>> > The
>> > script works fine run by itself, but psexec is giving me an error of
>> > "system
>> > cannot find the file specified". I'm sure it's a real basic thing, can
>> > someone tell me what is wrong??
>> >
>> > psexec \\mw_pc20 -u DOMAIN\administrator -p password
>> > \\mw_pc21\sharedfolder\file.vbs
>> >
>> > The pc20 is the target pc and the pc21 is mine in this example. I took
>> > notes before but apparently I'm missing something.

>>
>> When you execute a .VBS file directly then you rely on two things:
>> - That the system knows what to associate VBS files with
>> - That the system defaults to cscript.exe (which it usually does not).
>>
>> It is much safer to execute VB Scripts like so:
>>
>> cscript.exe //nologo file.vbs
>>
>>
>>
 
Back
Top