Solved

PSEXEC and Scripts

Posted on 2010-09-23
4
1,550 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AD Account lockout 11 99
Unable to hit site 2 56
Windows 10 Policy for Flash 3 59
Group Policy 5 21
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

752 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