Passing keystrokes into batch file

I need to execute a batch file, with the following keystrokes to be passed during its execution:
y
enter
y
How do i simulate the above 3 keystrokes into the batch file?
Thanks

It would be fairly simple to rewrite this in PowerShell.  Then you could use the Stop-Service cmdlet, which can automatically stop dependent services if you use the -Force parameter.  I haven't tested it, but this should do the trick.  You'll
need to run PowerShell as an administrator to use the script, of course (same thing you'd have to do to run that batch file):
Stop-Service -Name winmgmt -Force
Set-Location -Path c:\windows\system32\wbem
Rename-Item -Path .\Repository Repository.old
Remove-Item -Path .\Repository -Force -Recurse
regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dll
mofcomp cimwin32.mof
mofcomp cimwin32.mfl
mofcomp rsop.mof
mofcomp rsop.mfl
Get-ChildItem -Path .\*.dll -Recurse | ForEach-Object { regsvr32 /s $_.FullName }
Get-ChildItem -Path .\*.mof | ForEach-Object { mofcomp $_.FullName }
Get-ChildItem -Path .\*.mfl | ForEach-Object { mofcomp $_.FullName }
Restart-Computer -Force

Similar Messages

  • Incorporating .jar files into Batch files

    Hello, I've created an application that requires .jar files to operate correctly. I was able to get them into eclipse, which made me happy. I was able to figure out how to get them into a .html file when I went to put it on the web which made me even happier. But, then I discovered that I cannot use a html file to call it because of the security access exceptions that are ensued by placing the application on the web. I've come to the conclusion that I will use a Batch file (.bat) to run the app. The way I knew how to get them into the html file was to use:
    <applet code="MYCLASS.class" archive="MYCLASS_JARFILE.jar">
    </applet>Now I need to figure out how to achieve the same effect as that into a batch file that uses:
    java MYCLASSAny help would be greatly appreciated. Thanks.

    The applet uses I/O from a MySQL server. When launching it through the website (Not where the database is hosted from) the applet causes the following exception:
    java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:3306 connect,resolve)The applet in the end will be placed on the same server as the database but I was unsure if this issue would still persist, assuming it would I converted the applet into and executable JAR file and run it through the batch file which does not cause the same error.
    I read up on the signing applets and such and saw in most forums and articles, that it was a hard way to go and was a hassle. I also found out other articles advocating the use of applet--->servlet--->database however, I know very little about servlets. Currently I only have a semester of Java and have been constantly practicing it since the end of the semester. I learned MySQL and how to use it and right now I have an applet that stores and reads data from the MySQL server I've set up on my home network and uses a java applet GUI to allow manipulation of the data.
    Edited by: sfeher1 on Jul 21, 2009 9:36 PM

  • Webutil command into batch file

    Hello,
    We have a 10gR2 environment, with webutil.
    I get a weird behaviour with CLIENT_HOST.
    When I use this command
    myCommand := 'cmd /c COPY c:\file1.txt c:\toto.sql ';
    CLIENT_HOST(myCommand);
    There is no problem.When I use put the COPY command into a .bat file, in order to execute the .bat file with CLIENT_HOST ... the command doesn't make the job.
    There is no special information in the jInitiator console...
    But here is the code I'd like to write :
    myFile CLIENT_TEXT_IO.FILE_TYPE;
    myCommand VARCHAR2(1000);
    BEGIN
    myFile := CLIENT_TEXT_IO.FOPEN('c:\myBatch.bat', 'W');
    CLIENT_TEXT_IO.PUTF(myFile, 'COPY c:\file1.txt c:\toto.sql \n');
    CLIENT_TEXT_IO.FCLOSE(myFile);
    myCommand := 'cmd /c c:\myBatch.bat ';
    CLIENT_HOST(myCommand);
    END;
    Also, when I doubleClick on the myBatch.bat file under Windows, the command works fine !
    My problem is that I need to have a .bat file that gathers many commands. (this is not only about copying a file)
    What puzzles me, is that I don't have such problem with our 8i environment !
    That's why I was thinking about any special privilege/setup missing in our 10g environment / configuration...
    Any idea or advice?
    Thanks,
    Olivier

    Hi Olivier
    The problem is that the operative system hasn’t written the file yet, even though the fclose command as been executed.
    I used this type of code to check if the file is closed in the file system.
    loop
    l_counter := l_counter + 1;
    if webutil_file.file_size('c:\myBatch.bat') > 0 then
    CLIENT_HOST(myCommand);
    exit;
    end if;
    if l_counter > 100 then
    SET_ALERT_PROPERTY('UI_ERROR',alert_message_text,'Timeout. Copy can not be completed, due to file not being released by file system.' );
    l_button := show_alert('UI_ERROR');
         exit;
    end if;
    end loop;
    Hope this will help you solve the problem
    Cheers
    Nils Peter

  • Passing parameter values to powershell function from batch file

    Hello ,
       I haven't used powershell for a while and getting back to using it. I have a function and I want to figure out how to pass the parameter values to the function through batch file.
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    <#
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_011.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    #>
    The above code seems to be work when I call it. But when I try to call that script and try to pass the parameter values, I am doing something wrong but can't figure out what.
    powershell.exe -command " &{"C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"}"
    Write-Host "ReturnCode : $returncode"
    $file = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    powershell.exe -file "C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile $datafile
    Somehow the I can't get the datafile parameter value being passed to the function. Your help would be much appreciated.
    I90Runner

    I am not sure about calling a function in a script like how you want to. Also I see you are setting the values of the parameters, this is not needed unless you want default values if nothing is passed. The values for the parameters will be passed via the
    batch file. So for me the easiest way is as indicated.
    param
    [string]$DataFile
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    Write-Host "Return Code: $(Check-FileExists $DataFile)"
    Then you create a batch file that has
    start powershell.exe
    -ExecutionPolicy
    RemoteSigned -Command
    "& {<PathToScript>\MyScript.ps1 -DataFile 'C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile.txt'}"
    Double click the batch file, and it should open a powershell console, load your script and pass it the path specified, which then the script runs it and gives you your output
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • Runtime.exec() and batch files

    I am having a problem on Windows 2000 while trying to execute a batch file with the Runtime.exec() method. Basically, the exit value returned from the call to Runtime.exec(), returned specifically by the waitFor() method in the Process class, is always zero, even if the batch file fails miserably. After looking into batch files further, it seems to me that the only way to get the exit value of the commands run in the batch file back to the Runtime.exec() call is to put "EXIT %ERRORLEVEL%" in the batch file. What this actually does is exit the command(cmd) shell that the batch file was running in with the exit code of the last command run. This is all great when calling the batch file with a Runtime.exec() call, but when you run it in a cmd window, the window closes when the batch file completes, because the call to EXIT exits the entire shell. I guess i'm just wondering, am i correct in assuming the exit value returned to the java process is going to be the exit value of the shell in which the batch file is running? I need to have the exit value actually indicate whether the batch file ran successfully or not, and if i have to put in the EXIT %ERRORLEVE% (which exits the cmd shell with the exit value of the last command run), then i'll do that, but if someone knows a better way of doing this, i am all ears. Thanks in advance

    To run any command from java code, the method is
    Runtime.getRuntime().exec( myCommandString )
    Where, myCommandString is something like "/full/pathname/command".
    If the pathname contains spaces (specifically in Windows), e.g. "c:\program files\windows\notepad", then enclose it in quotes within the quoted string. Or pre-tokenize them into elements of an array and call exec(String[] cmd) instead of exec(String cmd).
    From JDK1.3 there are two new overloaded Runtime.exec() methods. These allow you to specify starting directory for the child process.
    Note, there is a gotcha associated with reading output from commands. When the runtime exec's the process, it passes to it 3 streams, for stdin, stdout, and stderr; the out and err are buffered but the buffer size isn't very big. When your process runs, it reads (if needed) from in, and writes to out and err.
    If it doesn't write more than the buffer-size, it can run to completion.
    But if it tries to write more data to one or the other stream than the buffer can hold, the write blocks, and your process hangs, waiting for you to empty the buffer so it can write some more.
    So after the exec call, get the streams, and read from them in a loop until they both hit end-of-stream (don't block on either one, just read whatever is available from each, each loop iteration).
    Then when the streams have ended, call the process.waitFor() method to let it finish dying.
    Now, here is a code snippet how you achieve this.
    String strCommand = "cmd.exe /c " + strCommand;
    // For Solaris / unix it will be
    // String strCommand = "/usr/cobra/sol/runInstaller.sh";
    boolean bWait = true;
    //execute the command
    try
         Runtime r = Runtime.getRuntime();
         Process pr = r.exec(strCommand);
         Process pr = r.exec(callAndArgs);
         BufferedInputStream bis =new BufferedInputStream(pr.getInputStream ());
         int c=0;
         /** Outlet for IO for the process **/
         while (c!=-1)
              c=bis.read();
         /**Now wait for the process to get finished **/
         if(bWait == true)
              pr.waitFor();
              pr.destroy();
    catch(Exception e)
         System.out.println("Could not execute process " + strCommand);
         return(false);

  • Batch File Search and Replace a String

    I've written a batch file to handle the copying of files.  I'm trying to reduce the number of parameters that I pass to the batch file.
    I want the batch file to perform a string replace on the directory path that is passed as a parameter to the batch file.
    Here is how I run the batch file:
    COPY_FILE.BAT C:\DATA\FTP_DATA\ACME\IN      (I'm passing directory path "C:\DATA\FTP_DATA\ACME\IN" as parameter %1)
    So my batch file will copy a file to the directory path represented by parameter %1.
    But then I want the file copied to a second directory.  I want the batch file to replace string "FTP_DATA" in the directory path with string "FTP_DATA\ARCHIVE"
    I know I could pass this path as a second parameter, but I want to limit the number of parameters so figured I could have the batch file perform a search and replace on string "FTP_DATA".
    After searching the internet, I thought I found the answer by using the following command in the batch file:
    set ARCHIVE_PATH=%1:FTP_DATA=FTP_DATA\ARCHIVE
    But it doesn't perform a search and replace.  It just appends to the directory path with the following result:
    C:\DATA\FTP_DATA\ACME\IN:FTP_DATA=FTP_DATA\ARCHIVE
    What I want is the this:
    C:\DATA\FTP_DATA\ARCHIVE\ACME\IN
    Any suggestions?

    Your syntax is not correct. Example:
    @echo off
    setlocal enableextensions
    set ARCHIVE_PATH=C:\DATA\FTP_DATA\ACME\IN
    echo %ARCHIVE_PATH%
    set ARCHIVE_PATH=%ARCHIVE_PATH:FTP_DATA=FTP_DATA\ARCHIVE%
    echo %ARCHIVE_PATH%
    endlocal
    -- Bill Stewart [Bill_Stewart]

  • Error handling from MAXL into a batch file

    Hello all
    I need to know how do we pass a value to a batch file from MAXL script if an error occurs.
    I have used the following in my MAXL to catch an error.
    ========================
    login username password on server01;
    Iferror 'error';
    Define Label 'error';
    Exit;
    =======================
    In the batch file I used:
    If %errorlevel% NEQ 0 goto catch
    :catch
    echo an error occurred during MAXL script
    Exit
    ========================
    This doesnt give me any error even the login info is wrong in the MAXL script
    Please correct if this is wrong and provide any help if possible
    Thanks in advance

    Here's the error checking code I used in my last not-DOS-but-we-call-it-that script:
    REM     Call MaxL script with parameters
    REM The 2>&1 at the end of the below line merges CMD's STDERR into STDOUT
    %hyperion_home%\products\essbase\essbaseclient\bin\essmsh.exe %batAutomation%\%esbAppName%\MaxL\%mshScriptName%.msh %esbUsername% %esbPassword% %esbServer% %esbAppName% %mshScriptName% %batDrive% %batAutomation% >>%log% 2>&1
    REM     Test for MaxL execution errors
    IF NOT %ERRORLEVEL% == 0 (SET errormsg=Error! - MaxL script %mshScriptName%.msh failed with ERRORLEVEL %ERRORLEVEL% & GOTO ERROR)The 2>&1 command at the end of the MaxL script line merges STDOUT and STDERR into an overall log file I used for other processes as well as MaxL. It's great for that purpose, but unfortunately logs the username and password -- this would be overcome by encrypting those values. It was acceptable for the solution so I didn't lose any sleep over it.
    Regards,
    Cameron Lackpour

  • Pass exit code from batch file to MDT 2012?

    So i have batch file that creates some directories, sets up the path for log files before i install an application ( msi installer).
    It goes something like this :
    MD C:\mylogfolders
    Set logfilename = C:\mylogfolders\appl1-date.log
    msiexec /i app1.msi /qb REBOOT="ReallySuppress" /l*e "%logfilename%"
    exit /B %errorlevel%
    This batch file was imported into MDT along with the msi files, and the silent command is running this batch file.
    The installation works fine, the log produced also indicates it is successfully installed, with error code 0. I double confirmed the errorlevel variable is 0 by echoing it.
    But at the summary pane, it always shows warning with error code 255 for this application. Is there any other way to pass the error code to MDT??

    The "exit /B %errorlevel%" line seems redundant. Why have the last line return the errorcode from the previous line?
    if this is an application run though ZTIApplications I would use the following:
    msiexec.exe /q app1.msi /qb reboot=ReallySuppress /l*e %logpath%\app1.msi
    http://keithga.wordpress.com/2013/09/04/application-installation-and-packaging-via-mdt-and-sccm/
    Keith Garner - keithga.wordpress.com

  • Powershell script calling batch file, how to "echo" or otherwise pass in two or more values asked for by batch file

    I've been having a lot of problems trying to get an old batch file we have laying around, to run from my powershell script. The batch file actually asks for two inputs from the user. I've managed to put together a powershell that echos a response, but of
    course, that only will answer one of the prompts. As usual, I've simplified things here to get my testing done. The batch file looks like this:
    @ECHO OFF
    SET /P CUSTID=Customer Number:
    SET /P DBCOUNT=Number of Live Databases:
    ECHO Customer Id was set to : %CUSTID%
    ECHO Database Count was set to : %DBCOUNT%
    Two inputs, two echos to verify values have been set. Now, the powershell looks like this:
    Param(
     [string]$ClientADG,
        [string]$ClientDBCount,
        [scriptblock]$Command
    $ClientADG = '1013'
    $ClientDBCount = '2'
    $Response = $ClientADG + "`r`n" + $ClientDBCount
    $Command = 'Invoke-Command -ComputerName localhost -ScriptBlock {cmd /c "echo ' + $ClientADG + ' | E:\Scripts\Setup\Company\DatabaseSetupTest.bat"}'
    powershell -command $Command
    Output looks like:
    Customer Number: Number of Live Databases: Customer Id was set to : 1013
    Database Count was set to :
    As expected, as I'm only passing in one value. I can't figure out how to get a second value passed in for the second prompt. Instead of $ClientADG, I tried to mash the two value together in the $Response variable with a cr/lf or a cr or a lf in between,
    but no go there either. The first input gets set to the second value, and second input is blank still. In the essence of time, I need to get this batch file called from Powershell to get some folks productive while I actually rewrite what the batch file does
    in another powershell, so it can be integrated into other things. (I'm automating what a bunch of people spend hours doing into multiple scripts and eventually one BIG script so they can focus on doing their real jobs instead).
    How do I get this right in powershell? I don't want to modify the batch file at all at this point, just get it running from the powershell.
    Thanks in advance!
    mpleaf

    It's a "simple" test so I can figure out how to get the arguments passed from ps to bat. The bat file looks like this:
    @ECHO OFF
    SET CUSTID = %1
    SET DBCOUNT = %2
    ECHO Customer Id was set to : %CUSTID%
    ECHO Database Count was set to : %DBCOUNT%
    That's it. The PS script looks like this:
    Invoke-Command-ComputerName myserver-ScriptBlock{cmd/c"E:\Scripts\Setup\Company\DatabaseSetupTest.bat
    1013 2"}
    That's it. The bat file exists on "myserver", and I'm getting the echo back, but without the values.
    mpleaf

  • Passing parameters from JSP to Batch file

    hi,
    i had a small problem regarding passing parameter from JSP to a batch file.
    My program is like this..........
    I wrote a batch file which opens and pings a remote system. Code looks like this......
    ping %1 -t
    which takes one argument and named this as "a.bat"
    The corresponding JSP page has lot of links which contains IP Addressess. From JSP page, i am calling "a.bat" so that it will open and start pinging corresponding IP Address. So i want to know how can i pass the corresponding IP from a JSP to batch file so that it start pinging remote machine........... can any body help me in this regard??
    Thanks in Advance.
    cheers,
    Sudhakar.

    it might be a permissions problem for the process itself. i once fought for some time with a java app that would mysteriously exit (no exceptions or any VM vomit) i finally discovered that the application was killed when the screen saver came on. just a regular screen saver mind you.
    at any rate i did see this issue and other strange ones like it reported here and there, i think i once say a bug report here on it but I can't seem to find it now. i believe this is fixed in 1.4.
    this of course may not be of much help to you.
    the two workarounds i found were 1) to turn off my screen-saver, 2) set up the program as an NT service. for the NT service i used this stuff http://www.kcmultimedia.com/
    so my suggestion for weird process permission problems on NT would be to try and make it into a service.

  • Passing schema name at runtime in batch file

    I am having a batch file where i am prompting users to tell the schema name to which they wish to connect at runtime. I am calling one .sql fil within that batch file to execute where i need user to connect to the specific schema at runtime
    My batch file looks like as
    set serveroutput on;
    set linesize 500;
    set scan on;
    spool test_bat.log
    Accept a PROMPT 'Enter the schema name you wish to connect: '
    Accept a_pw PROMPT 'Enter the password?: ' HIDE
    Accept a_connstr PROMPT 'Enter the connect string : '
    conn &a/&a_pw@&a_connstr
    Now after getting connected to the specified schema i would like to call some .sql file within the batch file which seems to be as
    select count(*) from <schema entered above>.table_name
    I want to use the above schema name (a) to get data from the tables.
    Please let me know how to get this.
    Thanks

    user11200661 wrote:
    That's fine but still i want to prefix the schema name within the .sql file. My .sql should contain the name of that parameter only as i want to get that parameter replaced by the schema name at runtime. Some other users are using the same .sql file and they have access to that specific schema only. i want to make the .sql file more general so that it can be used by everyone without altering it every time.Sorry, your requirement no longer makes sense.
    If people have to access a specific schema because they need the script for general use, then you will have to hard code the schema name into it.
    If the script is to prompt for the schema name and connect to that schema and then use that schema name inside the called sql script, then people would not be able to use it generically, as it would be reliant upon the schema name being passed in.
    It sounds as if you're trying to write one generic thing that needs to do two different tasks.
    Just have two scripts and make life simple.

  • How to pass arguments to a batch file from java code

    Hi
    I have a batch file (marcxml.bat) which has the following excerpt :
    @echo off
    if x==%1x goto howto
    java -cp C:\Downloads\Marcxml\marc4j.jar; C:\Downloads\Marcxml\marcxml.jar; %1 %2 %3
    goto end
    I'm calling this batch file from a java code with the following line of code:
    Process p = Runtime.getRuntime().exec("cmd /c start C:/Downloads/Marcxml/marcxml.bat");
    so ,that invokes the batch file.Till that point its ok.
    since the batch file accpets arguments(%1 %2 %3) how do i pass those arguments to the batch file from my code ...???
    %1 is a classname : for ex: gov.loc.marcxml.MARC21slim2MARC
    %2 is the name of the input file for ex : C:/Downloads/Marcxml/source.xml
    %3 is the name of the output file for ex: C:/Downloads/Marcxml/target.mrc
    could someone help me...
    if i include these parameters too along with the above line of code i.e
    Process p = Runtime.getRuntime().exec("cmd /c start C:/Downloads/Marcxml/marcxml.bat gov.loc.marcxml.MARC21slim2MARC C:\\Downloads\\Marcxml\\source.xml C:\\Downloads\\Marcxml\\target.mrc") ;
    I get the following error :
    Exception in thread main java.lang.Noclassdef foundError: c:Downloads\marcxml\source/xml
    could some one tell me if i'm doing the right way in passing the arguments to the batch file if not what is the right way??
    Message was edited by:
    justunme1

    1 - create a java class (Executer.java) for example:
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    public class Executer {
         public static void main(String[] args) {
              try {
                   for (int i = 0; i < args.length; i++) {
                        System.out.println(args);
                   Class<?> c = Class.forName(args[0]);
                   Class[] argTypes = new Class[] { String[].class };
                   Method main = c.getDeclaredMethod("main", argTypes);
                   // String[] mainArgs = Arrays.copyOfRange(args, 1, args.length); //JDK 6
                   //jdk <6
                   String[] mainArgs = new String[args.length - 1];
                   for (int i = 0; i < mainArgs.length; i++) {
                        mainArgs[i] = args[i + 1];
                   main.invoke(null, (Object) mainArgs);
                   // production code should handle these exceptions more gracefully
              } catch (ClassNotFoundException x) {
                   x.printStackTrace();
              } catch (NoSuchMethodException x) {
                   x.printStackTrace();
              } catch (IllegalAccessException x) {
                   x.printStackTrace();
              } catch (InvocationTargetException x) {
                   x.printStackTrace();
              } catch (Exception e) {
                   e.printStackTrace();
    2 - create a .bat file:
    @echo off
    java -cp C:\Downloads\Marcxml\marc4j.jar; C:\Downloads\Marcxml\marcxml.jar; Executer %TARGET_CLASS% %IN_FILE% %OUT_FILE%3 - use set command to pass variable:
    Open MS-DOS, and type the following:
    set TARGET_CLASS=MyTargetClass
    set IN_FILE=in.txt
    set OUT_FILE=out.txt
    Then run your .bat file (in the same ms dos window)
    Hope that Helps

  • Pass tablespace(s) as a parameter to RMAN using batch file (windows2000)

    I want to make a backup of one or more than one tablespaces.
    For Example:
    Backup tablespace USERS,TOOLS;
    Backup tablespace USERS;
    In this regards I am using windows batch file. Below you find the code of batch file which I am using to perform this operation (windows 2000)
    Batch file (c:\rman.cmd)
    set tbs1=%1
    set tbs2=,%2
    if exist tbs1 == goto usage
    if exist tbs2 == goto usage
    echo BACKUP tablespace %tbs1% %tbs2% ; > c:\temp\tbs.rman
    rman TARGET / @ c:\temp\tbs.rman
    Problem
    I run this batch file on command line .
    When I issue this command its ok and backed up both the tablespaces.
    Host @c:\rman.cmd USERS,TOOLS
    But when I want to backup only one tablespace and issue the command like that:
    Host @c:\rman.cmd USERS
    It gave the following error
    BACKUP tablespace users , ;
    Found comma after first tablespace.
    Point of focus
    How to get rid of the comma after first tablespace on run time, when I want to backup only one tablespace.
    BACKUP tablespace users , ;
    How to avoid that comma on run time when I only want to make a backup of single tablespace.
    Please check this matter it is only the batch file side problem.
    With Best Regards
    Fawad Ahmed

    I am not expert is DOS but I think you can fix this with
    a simple programming logic elements in the script.
    You have 2 cases:
    1 case ) When you have only one parameter
    2 case ) When you have more or equal than two parameters
    if exist tbs1 == goto mark1
    if exist tbs2 == goto mark2
    mark2:
    echo BACKUP tablespace %tbs1% %tbs2% ; > c:\temp\tbs.rman
    goto end
    mark1:
    echo BACKUP tablespace %tbs1% ; > c:\temp\tbs.rman
    goto end
    end:
    rman TARGET / @ c:\temp\tbs.rman
    This can be one the case for 1 or 2 parameters . If
    you think to pass more parameters you have to use
    another logic.
    I hope this can help you!
    Joel P�rez

  • Pass Passord Variable to a Batch File using Execute Process Task

    I have an FTP batch file that I want to execute using Execute Process Task. The content of the ftp (ftpscript.cmd) is as below:
    open ftpsite
    UserName
    Password
    ASCII
    get file  c:\temp\test.txt
    bye
    Using SSIS Execute process task, I was able to download data. I configured the Execute Process task as follows:
    Executable: ftp.exe
    Arguments: -s:"c:\temp\ftpscript.cmd"
    The above works fine. But the problem is that I don't want to store the password value in the batch file for security/policy reasons. Please, is there a way I can pass the password value to the ftp executable or the batch file at run time?
    I know how to get and store variables in SSIS but I don't know how to pass this kind of variable to the batch file just before execution.
    Any suggestions will be appreciated. Thanks.

    you can dynamically generate the source (CMD) for the FTP and delete after the execution. The password can be stored in a secure database for example, not 100 % secure, but the best you can do.
    Another option I did was an encrypted VBScript (also quite easy to open in plain text to some people).
    Finally it can be a binary e.g. an EXE with the FTP called as process in it.
    Arthur My Blog

  • Running batch files thraugh java by passing parameters

    Hi
    I want to run a batch file by passing some parameters.
    Eg: copy.bat "D:\live\hoe.txt" "D:\test"
    while doing this from command prompt its working and i have written some java code for running this batch file.
    String live="D:\\live\\how.txt";
    String test="D:\\test";
    String bat="D:\\copy.bat";
    String[] command = new String[3];
    command[0] = bat;
    command[1] = live;
    command[2] = test;
    try {
    Runtime.getRuntime().exec(command);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    but this time its not copying the file;
    Please help.

    Just another cross poster.
    [http://www.java-forums.org/new-java/15005-running-batch-files-thraugh-java-passing-parameters.html]
    db

Maybe you are looking for

  • Printing from Adobe Photoshop CS5 on a HP Color Laserjet CP5225 printer

    Hi When I want to print something out from Photoshop CS5 on my printer I get this error. PCL XL Error Subsystem: KERNEL Error: IllegalOperatorSequence File name: derived_scr/1x55.ndbg.kernel.c Line number: 1820 My windows system is Windows xp proffes

  • Boot camp or Parallel?

    With only 28 GB left on my HD, and my main interest in using windows is for video chatting on MSN Messenger and using Microsoft Office, which is more recommended way to go? Also, can this be reversed, meaning uninstall either one to go the other way

  • Question for a class

    Hey, I'm doing basic flash in a school class right now, and I have a question... ... there's a "vegetable term" used to describe following/seeing the motion path an object is taking. Do any of you know what it is?

  • BIG problem with zen v plus 2gb mp3 player HE

    i just brought my zen v plus today for 83 gbp i was scrolling through the radio channels and it decides to freeze on me i cant take it back because it was at abu dhabi airport any know how to sort the problem out? contact me on +44792328937 or post o

  • View image instantly on monitor from camera with USB connection

    Hello, What I want is to see my image instantly on monitor when I am taking a picture from example a portrait or a painting in the studio. The camera is connected with USB to the computer. Help!!