Solved

PSEXEC and Scripts

Posted on 2010-09-23
4
1,519 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:bmcquill
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
Krzysztof Pytko earned 500 total points
ID: 33741695
did you try using

psexec \\server-name -u user -p password cscript "path_to_vbs_file\vbs_file.vbs"
0
 

Author Closing Comment

by:bmcquill
ID: 33741712
That was it, I just totally forgot the cscript parameter in the command line.  Thanks!
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33741717
you're welcome :)
0
 

Author Comment

by:bmcquill
ID: 33744005
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

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now