PSEXEC and Scripts

I have a windows server 2008 R2  machine that is in a workgroup.  I'm trying to run a vbscript I wrote and it keeps telling me it can't find the file.  I copied the file over earlier when connected to the file share.  I have enabled winrm on the machine and all firewall rules.  I also tried using psxec -c "filename" to copy the file over again and try running, same result.  I run psexec \\server-name -u user -p password cmd.exe, that works, I then say run the file and it runs it.  I have a fair number of machines and would like to just run the scripts from the command line with one psexec command not from an interactive command prompt, but it never sees the file (i've checked the name of the file and path ad nauseum, just doesn't find it).  Any one have ideas?
bmcquillAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Krzysztof PytkoConnect With a Mentor Senior Active Directory EngineerCommented:
did you try using

psexec \\server-name -u user -p password cscript "path_to_vbs_file\vbs_file.vbs"
0
 
bmcquillAuthor Commented:
That was it, I just totally forgot the cscript parameter in the command line.  Thanks!
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
you're welcome :)
0
 
bmcquillAuthor Commented:
Not that I want to continue this thread too unnecessarily, but it's really strange to me that forgetting the cscript parameter, gave a "file not found" error, instead of a execution failure.  That's what really had me fooled, I haven't seen that before, wonder why that was the case, anyway.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.