Solved

Psexec execute a vbs remotely without username or password

Posted on 2011-02-23
1
1,642 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
1 Comment
 
LVL 83

Accepted Solution

by:
oBdA earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Parsing an RSS Feed 4 23
in what format to convert 4 k without losing quality? 12 30
Selenium and Interactive Data Language 3 21
Picture size 4 19
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

825 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