Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Psexec execute a vbs remotely without username or password

Posted on 2011-02-23
1
Medium Priority
?
1,723 Views
Last Modified: 2012-08-13
Hi,

I need to be able to run a script with PsExec without specifiyng username or password

here it is.

the process is to extend a virtual drive ona remote server.

First I run the batch file:

doexpand.cmd server e:\

@echo off
---
set SERVER=%1
set PARTITION=%2

C:\bootini\PsTools\PsExec.exe \\%SERVER% cscript "\\10.66.66.49\bootini\extend\"extendvb.vbs %PARTITION%""
---
the extendvb runs fine locally.

But when I use the psexec, it says:

C:\Users\malabelle\Desktop\tests\extend>doexpand.cmd SEQDEV3 e:\
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

CScript Error: Loading script "\\10.66.66.49\bootini\extend\extendvb.vbs" failed
 (Access is denied. ).
cscript exited on SEQDEV3 with error code 1.

I check the share and it works and the permissions are good.

any ideas?

0
Comment
Question by:malabelle
[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
1 Comment
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 total points
ID: 34964384
Won't work; check psexec's help: "If you omit a user name the process will run in the context of your account on the remote system, but will not have access to network resources (because it is impersonating). Specify a valid user name in the Domain\User syntax if the remote process requires access to network resources or to run in a different account. Note that the password is transmitted in clear text to the remote system."
You need to copy extendvb.vbs to the remote machine, then run it locally; example:
@echo off
set SERVER=%1
set PARTITION=%2
if not exist \\%SERVER%\c$\temp md \\%SERVER%\c$\temp
copy \\10.66.66.49\bootini\extend\extendvb.vbs \\%SERVER%\c$\temp
C:\bootini\PsTools\PsExec.exe \\%SERVER% cscript.exe C:\Temp\extendvb.vbs %PARTITION%

Open in new window

0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

722 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