Solved

Psexec execute a vbs remotely without username or password

Posted on 2011-02-23
1
1,620 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
nmap scanner? 7 78
Connecting two servers 30 47
Disabling Admin account 1 38
how to get the largest file size? 33 42
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
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…
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…

705 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

12 Experts available now in Live!

Get 1:1 Help Now