
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2013 08:51 PM
I am not sure if anyone can help with this or not. I am looking to write a vb script that will pull the computer name I run it on and will take username and password from me and use those to run a command. I am using psexec and want to have a custom action that launches a remote cmd window for the machine I run it on. If there is a better way to do this I am open to hearing that as well. I currently have the script pulling the name right if I echo it, but it is not letting me insert that into a cmd command
.
Any help would be great. Thanks in advance.
Nick

Any help would be great. Thanks in advance.
Nick
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2013 06:33 PM
If WScript.Arguments.Count = 1 Then
strcomputer= WScript.Arguments(0)
Dim wshShell
Set wshShell = WScript.CreateObject("WScript.Shell")
wshShell.Run "\\<lansweeperserver>\actions\pstools\psexec.exe " & strcomputer & "<command>"
Set wshShell = Nothing
WScript.Quit

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2013 08:15 PM
for use outside lansweeper you could use this in a batch file...or trigger the batch inside lansweeper...idk...havent tried that ...
BATCHFILE CONTENT:::
@echo off
:rerun
echo Enter Machine Name OR IP Address
set /p machine=
psexec \\%machine% cmd
echo Do you want to run it again? y or n
set /p ans=
@ECHO OFF
IF %ans%==y GOTO rerun
IF %ans%==n GOTO No
:No
GOTO End
:end
BATCHFILE CONTENT:::
@echo off
:rerun
echo Enter Machine Name OR IP Address
set /p machine=
psexec \\%machine% cmd
echo Do you want to run it again? y or n
set /p ans=
@ECHO OFF
IF %ans%==y GOTO rerun
IF %ans%==n GOTO No
:No
GOTO End
:end

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2013 07:56 PM
I am not sure why yours asks for cred's....mine just runs and works...
{actionpath}psexec \\{computer} cmd
this should work under current user...
{actionpath}psexec \\{computer} cmd
this should work under current user...

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2013 07:11 PM
No one has any idea?


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2013 09:09 PM
I found that it is easier to pass this command "{actionpath}pstools\PsExec.exe \\{computer} -u domain\username -p password cmd" Is there a way to insert credentials of currently logged in lasweeper user? or prompt for credential input? I would rather not have credentials hard coded in the command itself.
