Pushing scripts or batch files in Windows VM

I think I'm in the correct community, but if not let me know and I'll move on to the question in the correct forum.

We use vSphere 4.0 and I would push a batch file and scripts for all our virtual machines of Windows (instead of opening each Windows vm and manually run the batch/scripts)...is it anything in vSphere that would allow me to do it, or there at - it an addon or another program that would make this possible?)

I searched this forum, searched the help of vSphere and google than a few keywords, but I can't seem to find any information on this.

Thank you

Yes, VMware has an API called VIX which enables comments management, one of the features are the ability to upload or download files to and from the guestOS. VIX uses VMware Tools to perform these operations and you can run a specific command within a prompt OR download and run a script.

For more information, VIX, please take a look here - http://www.vmware.com/support/developer/vix-api/

There are some integration with PowerCLI cmdlets with VIX if you are more comfortable in Windows, there are PowerCLI forum you can ask your question - http://communities.vmware.com/community/vmtn/vsphere/automationtools/powercli

So according to the language of comfort, you can easily hang VIX API using vSphere SDK for Java, PowerCLI, Perl, etc.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at: http://www.virtuallyghetto.com/

Twitter: @lamw

repository scripts vGhetto

Introduction to the vMA (tips/tricks)

Getting started with vSphere SDK for Perl

VMware Code Central - Scripts/code samples for developers and administrators

VMware developer community

If you find this information useful, please give points to "correct" or "useful".

Tags: VMware

Similar Questions

  • Run the PLSQL Script from Batch file

    I am trying to run a PL/SQL script in a batch file in sp1 Windows 7 Prof

    N ° 1) I wrote a simple PL/SQL script:

    --

    -The scope of variables

    --

    DECLARE

    v_sal number (7.2): = 50000;

    v_comm number (7.2): = v_sal *. 20;

    v_message varchar2 (100): = 'eligible for the commission;

    BEGIN

    declare

    v_sal number (7.2): = 50000;

    v_comm number (7.2): = 0;

    v_total_comp number (7.2): = v_sal + v_comm;

    Start

    v_message: = "not committed not" | v_message;

    dbms_output.put_line (' message of sub-block is ' | v_message);

    dbms_output.put_line (' subblock v_comm is ' | v_comm);

    end;

    v_message: = 'seller '. v_message;

    -dbms_output.put_line ('Main block v_total_comp' | v_total_comp); -Error: not visible in the main block

    dbms_output.put_line ('Main block v_comm' | v_comm);

    dbms_output.put_line (' main block message is ' | v_message);

    END;

    /

    Step 2) then I wrote a simple batch TstBatch.bat file

    sqlplus scott/tiger@orcl < PLSqlVarInputTst1.sql > > TstBatch.log

    Step 3) in the BACK of cmd, I tried to run TstBatch.bat

    C: > TstBatch.bat

    The log file tells me that I have connected to Oracle Database 11 g Enterprise Edition Release...

    Then a lot of SQL > SQL > SQL >... 26 times

    Procedue of PL/SQL completed successfully.

    Disconnected from Oracle database

    I also tried running the PLSQL script in SQLPlus:

    SQL: > @PLSqlVarInputTst1.sql

    Tell me the procedure completed successfully.

    QUESTION: So, where is the output of the PL/SQL script?

    Hello

    You must activate the output: Add the following line at the beginning of your PL/SQL script:

    SET SERVEROUT ON

    ...

  • LEARNING OF BATCH FILES AND WINDOWS CANNOT FIND ' C:\DOCUMENTS'__

    Technical info: Windows XP Pro SP 2. Microsft Office home and Student 2007. AVG Free 9.0.

    Hello

    I am trying to learn the basics of Batch files and am confused right now. I can get a. BAT file to produce a BACK screen and play with some commands, but when I try to get a. BAT file to open a MS Word 07 Doc I get the following message

    Windows cannot find 'C:\Documents '. It stops at Documents. When infact the entire address would include Documents\testdoc or something else. I use Notepad to write the. BAT files.

    If I go into the file target itself and copy and paste the address in XP search utility, it locates the file (with a full name), instantly. But if I do the same copy and paste, paste the address directly in. BAT file for example: C:\windows, DEPARTURE etc etc... It is just straight up with the above mentioned error message.

    All advice forge kindly appreciated. My ultimate goal is to learn how to create a Batch file that will erase the files in different directories about five or six on the click of a button.

    Thanks Mick.

    I'm not an expert in writing .bat files. If no one else is here, you should post on the MSDN forums or there may be a group of newsgroups for .bat file writing.

    http://social.msdn.Microsoft.com/forums/en-us/categories

    I'm sorry that I wasn't able to help you.

    MS - MVP - Elephant Boy computers - don't panic!

  • Run a batch file in windows separated box to call DRM client batch

    I need your suggestions on what follows.

    ODI & DRM are installed on separate boxes.

    Now, I want to ODI to call a batch file (kept on DRM - Windows box, this batch file called client batch DRM for export metadata). I tried to use the notion of shared folder, but without success.

    Pointers please?

    This should work for you-

    Create a batch on your current server (ODI) file and write in the path to the other file of commands on the other server.

    Server2completename/D$/path/yourbatchfile.bat

    Calling your batch file that you created on the same machine... which inturn will call the other on another machine batch file to run the batch client from the ODI.

    Also you can paste errors that you can get... need to check if you get any specific problem related to this.

    Thank you

    Denzz

  • MaxL Script and batch file

    I have a MaxL script that exports data from different cubes Level0. I have a batch file to call this script at daily intervals.

    I want to name something out of different every day (preferably NAMEmmdd type format). I know that I can add a rename or move the lot but wonder if there is a MaxL method that will allow me to export to another name?

    Current MaxL is simply
    export database APP. Level0 data_file DB database ' ' $Arborpath\am1119.txt "";

    Ideas or direction to go learn the answer?

    T,
    J

    Hello

    You can enter variables in maxl, so you the calling batch file can pass in a variable that contains the name of the file with the current date...

    For example, you have a batch file
    essmsh c:\temp\export.mxl "C:\temp\output%DATE:~3,2%%DATE:~0,2%.txt".

    If that was run today it would pass in ' C:\temp\output1118.txt

    Now in your maxl you just refer to the variable with

    export data from database sample.basic Level0 to data_file $1;

    $1 refers to the variable which has been adopted, the 1 being the position, in which it was adopted.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Batch file to run the MaxL script

    Hi all

    Can someone tell me please how to run a MaxL script by using a batch file in Windows (XP). I use Essbase 11.1.1.3.

    It would be great if someone could send a .bat file, I'm not sure of the syntax.

    See you soon,.
    Sahil

    John gives you the right way re the Ref Tech.

    If you want the code, you can check my post (a bit old but still perfectly usable) here:
    http://camerons-blog-for-Essbase-hackers.blogspot.com/2009/07/fixing-plannings-filters.html

    You can download the code via this post as well.

    Kind regards

    Cameron Lackpour

  • Windows 7 keeps looping in my batch files

    I recently bought a new computer and Windows 7 came over her.  I like it so far.  I just have a problem.  I can't run batch files.

    If I open the command prompt and type:

    stop s f

    everything works fine.  I gives me a notice that my computer shuts down in less than a minute.  But I put exactly the same inside a file, I named "shutdown.bat" command prompt appears and shows exactly what I typed, skip a line, then it displays again and again and again and again...

    So I am confused.  I've been reading about people having problems with batch files in Windows 7, but my problem seems completely different from theirs.

    Now all I know is:

    • command prompt will still receive the shutdown command
    • My batch file run when double click
    • contents of the batch file will not run

    If anyone can help?

    It is a classic case of the dog bites his tail. When you put the command

    stop s f

    in your batch file then this command executes the batch itself rather than shutdown.exe, as shutdown.bat is located in the current folder! There are several ways to solve this problem, but the safest is to avoid at all costs to name your batch file identical to a system file. Rename it to MyShutdown.bat and your problem will be solved.

  • Batch file for migration and closing the virtual computer

    Hello, currently my company uses visualization of network monitoring software that allows us to react when certain thresholds are exceeded. We seek to define a threshold for when our UPS reaches a certain point (i.e. a point where the battery is discharged) and we would like to run a script or batch file that stops certain s VM, migrate some s VM for a single host and stop some ESX hosts. We want to create as much time as possible for our virtual machines essential.  I came across this tool and wonder if someone has done something similar? I'm not very familiar with batch files, and I'm fighting to run second and third commands. My current batch file looks like this: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe - PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" - NoExit-command ' Connect-VIServer VIServer-user 'exampleusername'-'examplepassword' password ' I can't run additional commands after connection. As I said I'm not very good with batch files and I am new with this program.   If someone could point me in the right direction of the execution of the additional commands from a batch file after you have connected the script above, I would appreciate it a lot.
    I also would be interested in other ideas, if others have done similar things for the same purpose.
    Thank you very much!

    Instead of real orders of PS during the invocation of PowerShell, you might call a. Ps1 script that contains all of the instructions of PS.

    To call the script from a command file, you can do something like this

    C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" c:\your_script.ps1
    
  • Batch file gurus: how to copy don't miss it that files between parallel folder by using UNC paths trees

    The problem: you have two directories structures identical, a source and a target.  (Let's say \\srchost\srcfolder and c:\destfolder.)  The goal: using a batch file in Windows XP, browse to the source folders and add all files to the destination tree that do not already exist there.  We are not concerned with the dates, only if the file exists.

    The Replace command has a parameter /a which will do that to a single file, but it will not browse.

    Using the command ForFiles to browse directories and pass them to replace does not work because it does not support UNC paths.

    Winds with the command For being... infernal.  Here is some of the best I have to this day, in the form of a batch file called with the paths of the src and dest as parameters:

    Set srcpath = % ~ f1
    the value destpath = % ~ f2
    for/r % srcpath % (.) DO)
    Set tmpsrc = %% ~ fi
    Set tmpdest = % destpath
    otherwise! tmpsrc! is % srcpath % set tmpdest = call! tmpdest! tmpsrc: % % = srcpath!
    replace/a! tmpsrc! \ *. * « ! tmpdest! »
    )

    I think we can all agree this is really obnoxious, especially because it works only if you start the shell with the V switch: WE.

    This turns into an unhealthy obsession for me.  I wanted a simple batch file solution to this since, oh, around 1990.  Surely, there must be a better way!  Can someone enlighten me?

    And just at the head of some obvious answers:

    1. No, I don't have the option to install just .

    2. do not forget that it must work with the UNC paths, so ForFiles is out.

    Thank you for your ideas!  I really sleep better if there is a healthy way to run this seemlingly simple task.

    -Roy

    Robocopy with . /XF looks like a possibility.

    "Roy Feague" wrote in the new message: * e-mail address is removed from the privacy... *

    The problem: you have two directories structures identical, a source and a target.  (Let's say \\srchost\srcfolder and c:\destfolder.)  The goal: using a batch file in Windows XP, browse to the source folders and add all files to the destination tree that do not already exist there.  We are not concerned with the dates, only if the file exists.

    The Replace command has a parameter /a which will do that to a single file, but it will not browse.

    Using the command ForFiles to browse directories and pass them to replace does not work because it does not support UNC paths.

    Winds with the command For being... infernal.  Here is some of the best I have to this day, in the form of a batch file called with the paths of the src and dest as parameters:

    Set srcpath = % ~ f1
    the value destpath = % ~ f2
    for/r % srcpath % (.) DO)
    Set tmpsrc = %% ~ fi
    Set tmpdest = % destpath
    otherwise! tmpsrc! is % srcpath % set tmpdest = call! tmpdest! tmpsrc: % % = srcpath!
    replace/a! tmpsrc! \ *. * « ! tmpdest! »
    )
    I think we can all agree this is really obnoxious, especially because it works only if you start the shell with the V switch: WE.

    This turns into an unhealthy obsession for me.  I wanted a simple batch file solution to this since, oh, around 1990.  Surely, there must be a better way!  Can someone enlighten me?

    And just at the head of some obvious answers:

    1. No, I don't have the option to install just .
    2. do not forget that it must work with the UNC paths, so ForFiles is out.
    Thank you for your ideas!  I really sleep better if there is a healthy way to run this seemlingly simple task.
    -Roy

  • Batch file to start and stop

    Hi all

    Can we create a batch file to start and stop services. I need to start all as shared services, essbase, eas, planning, webanlysis and financial information and also the need to stop using the windows batch file. (Windows 2003 server... using service pack 1). Any help would be appreciated.

    Thank you

    Yes replacing the beginning with a stop will stop them. I would like to add the command to sleep between them to give them time to stop or start. It takes more time, but I had less problems if I did that, I found

  • MS Dos command or batch file script

    How to remove files from a folder while MS-DOS command or batch file script keeping the last 15 days in windows server 2003R? Help, please

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
  • Is it possible to use the batch is script to retrieve the value window server political group?

    Y at - it a batch command that will allow me to recover the value of group policy in Windows server? Something like gpedit.msc did, but I want because of the command line I want to convert this value to format I want.

    Example: If I open gpedit.msc, then I go to Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Restore files and directories so I can get the value (administrators, backup operators) of this policy.

    All ways in the batch script can bring me to this path and capture value?

    Thanks, your help is very appreciated.

    Hello

    You could try to look at the list of Group Policy scripts or repost the question to the Scripting Guys or in Forum Windows Server forum.

    The guys from script

    Windows Server

  • How to upgrade a driver automatically in Windows NT by using the batch file

    I use the devcon tool to update a Windows XP driver, but unfortunately it does not support Windows NT. So I'm looking for a similar tool for Windows NT. Does anyone know any tool / or script that would update a driver via file/command line in Windows NT?

    Thank you for taking the time to read the question.

    Hello supportalcon,

    Thank you for the question!

    It is disheartening to know that have problems you with the Windows Driver. As I understand it, you need to update a driver automatically in Windows NT by using the batch file.

    The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums. You can follow the link to your question:

    http://social.msdn.Microsoft.com/forums/en-us/categories/

    Meet us if you face any problem of Windows, and I'd be happy to help you again and try to correct the problem as soon as possible.

    Good day!

    Hope this information helps.

  • MS-DOS (script) to execute in WindowsXP - batch file 'trap' the errorlevel

    I am writing a Batch MS-DOS (script) file to run in Windows XP.  It run 3 programs: PKZIP for z/OS by PKWARE, FTP (BACK) and an MS-DOS Application with us.  How I 'trap' the errorlevel to each of these programs to ensure that they completed successfully?

    Hello

    Because the problem is related to the batch file, I recommend that you post this question in the MSDN forum.
    http://social.msdn.Microsoft.com/forums/en-us/categories/

  • Autorun script or a Batch file to launch the cd w / Autorun is disabled.

    We shot some Autorun at the AD level.   Does anyone know of a batch file or a script that I could use to launch the CD for a small population of employees?

    Hi LeonardCarrier,

    The issue of Windows XP, you have posted is related to Windows XP in a domain environment. It is better suited for the IT Pro TechNet public. Please ask your question in the TechNet forums for assistance.

    Hope the helps of information.

Maybe you are looking for

  • Photo of RGB of treatment with the functions of the IMAQ

    Hello! I have a CMUcam. I take a picture and I try to use the IMAQ functions to process the image, but they do not accept the image as input. :'( How these functions can see the image? Thanks for your help!

  • Keithley 23xx cannot get driver to work

    Hi all I have looked around the forum and couldn't find that everything about the pilot 23xx. I have the Keithley running with the meaning and the Source + / connected to output 1 according to my analysis on a forum of Keithley (http://forum.keithley

  • HP OfficeJet 8600 border less printing

    I've read through the forums and found nothing, apart from somone saying probably a problem with the print bed. Every setting I can put it on the printer driver and in word are set on edge to edge borderless. I tried to re install the drivers, but th

  • Download files from the Internet will not end

    I have a problem downloading of the content of any Internet site.  I use IE 8 and Mozilla Firefox and downloads will start but never finished, while using a browser.  Downloads crash at different points in the download process.  The download process

  • Windows Mail problem - getting repeated email sent with new e-mail

    I have windows mail, and something happened with the mail I had to keep getting seen previously and deleted email sent back to me with new messages every time I click on SEND/RECEIVE Mail.  So, I have to go back through repeated messages and delete.