Replacement for command prompt

Hai all,
I would like to create a replacement for dos command prompt so that all outputs(System.out ) is redirected to this window and all input (System.in) is recieved form this window. I would like to have your suggestions and helps for this.
Thanks,
joe

Replacing System.in, System.err (don't forget that one) and System.out is relatively easy (see java.lang.System) - methods are provided for implementing these. Simply implement your own java.io.InputStream and java.io.PrintStream - these take and get bytes/chars/Strings from your UI component. The UI component will probably have to be a custom widget where you can have full control of it (either that or use a text area for the PrintStream(s) and a text box to feed the InputStream. Note that Java will have problems shelling batch files and legacy text mode applications (e.g. MS-DOS Edit); if you plan to do this, concentrate here first (even with the current console).

Similar Messages

  • Issue with KeyEvent for Command Prompt

    Using below code, when Event keys like “F7” are executed on the application to test while running from openscript it works fine.
    Whereas if the same script is executed using command line as below, then “F7” is executed for command prompt itself instead of application to test. 
    “C:\OracleATS\openScript\runScript.bat \\10.184.82.45\SharedRepository\Mysharedscript\Mysharedscript.jwg -delayPercentage 1”
    Code =>
    ft.typeKeyCode(KeyEvent.VK_F7);

    Try using
    ft.keyDown(KeyEvent.VK_F7)
    ft.keyUp(KeyEvent.VK_F7)

  • Wait for command prompt - Enter-PSSession

    Enter-PSSession -ComputerName ServerName
    Restart-Service DNS -PassThru
    Exit-PSSession
    I am trying to restart the DNS Server service on several remote machines using a foreach loop.  The problem is the the script does not wait until the command prompt shows up after executing the "Enter-PSSession -ComputerName ServerName". 
    I have not been able to fine a way to tell the script to wait for the prompt before continuing the script.   Thank you for any assistance that can be provided.

    You can use
    Invoke-Command rather than entering a PS-Session.
    Something like this may do what you need:
    $servers = @("Server1.fqdn.example.com","Server2.fqdn.example.com","Server3.fqdn.example.com")
    $scriptblock = "Restart-Service DNS"
    foreach ($server in $servers) {
    Invoke-Command -ScriptBlock $scriptblock -ComputerName $server
    Replace the server names in $servers with your actual server names. This assumes of course you have PSRemoting enabled which you would need for the PSSessions.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Command Prompt Tricks

    In the Command Prompt Shortcut, how can I change
    C:\Users\Lucky>
    into
    C:\
    Please Help
    Amanda

    When you open a Command Prompt window (CMD.EXE), it defaults
    to your user profile home directory. If you wish to change the
    default startup directory for Command Prompt, use the steps listed
    in this article at
    http://windowsxp.mvps.org/autoruncmd.htm

  • Command prompt is not opening

    Hi,
    i tried to open 'COMMAND PROMPT'. but not able to open. what is the problem and where should i need to change the settings for command prompt.
    Regards,
    venkat.

    I'm going to assume you are on Windoze and are talking about a Windows Command prompt. If so, click on the Start button, then click on Run and type cmd and then click OK.

  • Code for how to read an integer array from the command prompt...

    hello,
    Could anyone give me the code for how to read an integer array from the command prompt...its very urgent!..

    If you are using a recent version of Java (5 or later) you can use Scanner:
    http://java.sun.com/javase/6/docs/api/java/util/Scanner.html
    That page has some example code on it, too.

  • How can we write the code for opening the command prompt and closing the

    how can we write the code in java for opening the command prompt and closing the cmd prompt from eclipse (cmd prompt should close when click on the turminate button in eclipse)

    rakeshsikha wrote:
    how can we write the code for opening the command prompt and closing theBy typing in Eclipse (which you seemingly have)?

  • HELP FOR RUN PHOTOSHOP IN COMMAND PROMPT AND OPEN FILE

    HELLO
    i have problem for run photoshop in cmd(command prompt) and
    open a file immediate
    for example:
    D:\Program Files\Adobe\Photoshop CS>Photoshop.exe -open -f:\1.jpg
    but these not answer
    I need parameter open in photoshop
    please help me
    thanks

    I would right click on 1.jpg. Select Open with... Select Choose default program... Pick Photoshop and make sure you check "always use the selected program to open this kind of file."
    D:\1.jpg
    Would then open photoshop.

  • Is there any way to launch Shared Services in command prompt for migration?

    Hi All,
    We are on 11.1.1.1.3 Is there any way to launch Shared Services in command prompt for migration purposes? The purpose is we need to automate the migration process from Dev to Prod. Currently we are exporting artifacts by using LCM in shared service by file management and then exporting that folder to prod server and then importing by using LCM. So we need to automate the whole process.
    So is there any way we can launch shared services/LCM in command prompt to launch the migration for export/import artifacts?
    Any suggestions will be great help.

    Did you see the bit in the documentation called "Creating Migration Definitions"?
    See: http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_lifecycle_management/ch06s03s01.htm
    Also, if you follow this link, the docs explain how to (sort of) generate the xml:
    http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_lifecycle_management/ch06s03.htm
    Regards,
    Cameron Lackpour

  • Unable to telnet on command prompt for udp port 514, but able to on cmd for tcp port 514

    I am unable to telnet on command prompt for udp port 514. But when I use packet snifer or wireshark I am able to see traffic going to the targetted server from udp port 514. I thought it might be a firewall issue blocking the port from communicating. But
    I figured out that windows firewall is disabled. I am able to make similar connections on the cmd for tcp port 514.
    I did a netstat -an and see that udp:514 is enabled and listening on the server.
    What am I missing here?

    Telnet actually supports TCP only. You might want to try another tool as suggested here: http://serverfault.com/questions/263032/how-to-connect-to-a-udp-port-command-line
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • Silent installation for FMW products command prompt stuck!!

    Hi All,
    I am working on silent installation of Oracle FMW components, I am using the response file approach and Oracle Universal Installer. The aim is to integrate these installation commands to continuous integration tools like Jenkins/ControlTier.
    When the installation finishes, the current shell still holds the prompt. I need to press ENTER to get out. The problem If I integrate them with this tools their flow does not end up, as command prompt does not return. In addition to that I need the returned execution status (echo $?) for evaluating the process.
    I have tried launching it in background but did not work, any ideas ?
    They say, silent does not require user interaction still we have to press ENTER to exit the console (silent + GUI).
    Please suggest.
    Thanks in advance,
    Bhaskar
    I am posting one of the application installation output to give a better idea(Oracle Webtier Utilities):
    =========================================================
    bash-3.2$ ./runInstaller -silent -responseFile /sarbackups1/infra_build/response/WebtierSOA_InstallOnly_11.1.1.4.rsp &
    [1] 17055
    -bash-3.2$ Starting Oracle Universal Installer...
    Checking Temp space: must be greater than 80 MB. Actual 3578 MB Passed
    Checking swap space: must be greater than 500 MB. Actual 28991 MB Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-02-21_04-40-33PM. Please wait ..../runInstaller: syntax error at line 299: `count1=$' unexpected
    Log: /u01/app/oracle/oraInventory/logs/install2012-02-21_04-40-33PM.log
    Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
    Reading response file..
    Expected result: One of 5.9,5.10
    Actual Result: 5.10
    Check complete. The overall result of this check is: Passed
    CertifiedVersions Check: Success.
    Checking for SUNWarc; found Lint Libraries (usr)(SUNWarc). Passed
    Checking for SUNWbtool; found CCS tools bundled with SunOS(SUNWbtool). Passed
    Checking for SUNWhea; found SunOS Header Files(SUNWhea). Passed
    Checking for SUNWlibC; found Sun Workshop Compilers Bundled libC(SUNWlibC). Passed
    Checking for SUNWlibm; found Math & Microtasking Library Headers & Lint Files (Usr)(SUNWlibm). Passed
    Checking for SUNWlibms; found Math & Microtasking Libraries (Usr)(SUNWlibms). Passed
    Checking for SUNWsprot; found Solaris Bundled tools(SUNWsprot). Passed
    Checking for SUNWtoo; found Programming Tools(SUNWtoo). Passed
    Checking for SUNWi1of; found ISO-8859-1 (Latin-1) Optional Fonts(SUNWi1of). Passed
    Checking for SUNWi1cs; found X11 ISO8859-1 Codeset Support(SUNWi1cs). Passed
    Checking for SUNWi15cs; found X11 ISO8859-15 Codeset Support(SUNWi15cs). Passed
    Checking for SUNWxwfnt; found X Window System platform required fonts(SUNWxwfnt). Passed
    Check complete. The overall result of this check is: Passed
    Packages Check: Success.
    Checking for 127111-02; found 127127-11. Passed
    Checking for 137111-04; found 137137-09. Passed
    Check complete. The overall result of this check is: Passed
    Patches Check: Success.
    Expected result: 1024MB
    Actual Result: 16384MB
    Check complete. The overall result of this check is: Passed
    TotalMemory Check: Success.
    Verifying data......
    Copying Files...
    -----------20%----------40%----------60%----------80%--------100%
    Applying Oneoff Patch...
    [CONFIG] Launching Config Actions....
    Started Configuration:Web Tier Configuration
    [CONFIG]:Create and Start AS Instance (Web_PIT3)
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Creating Oracle Instance directories...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Recording OPMN ports reservations...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Bootstrapping OPMN configuration files...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Instantiating opmnctl for direct usage...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Skipping instance registration
    [CONFIG] SUCCESS:Create and Start AS Instance (Web_PIT3)
    [CONFIG]:Create and Start OHS Component (ohs_PIT3)
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Creating empty component directories...
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Provisioning OHS files for ohs_PIT3
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Copying OHS files from ORACLE_HOME to ORACLE_INSTANCE locations
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Customizing httpd.conf
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Adding component's process control to OPMN...
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Skipping ohs_PIT3 component registration.
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Invoking opmn reload...
    [CONFIG] SUCCESS:Create and Start OHS Component (ohs_PIT3)
    [CONFIG]:Create and Start Web Cache Component (webcache_PIT3)
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Creating empty component directories...
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Provisioning WebCache files for webcache_PIT3
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Copying WebCache files from ORACLE_HOME to ORACLE_INSTANCE locations
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Customizing webcache.xml
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Adding component's process control to OPMN...
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Skipping webcache_PIT3 component registration.
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Invoking opmn reload...
    [CONFIG] SUCCESS:Create and Start Web Cache Component (webcache_PIT3)
    Configuration:Web Tier Configuration completed successfully
    The installation of Oracle AS Common Toplevel Component, Oracle WebTier and Utilities CD completed successfully.
    Prompt holds here I have to press ENTER to come out
    =========================================================

    Hi All,
    I am working on silent installation of Oracle FMW components, I am using the response file approach and Oracle Universal Installer. The aim is to integrate these installation commands to continuous integration tools like Jenkins/ControlTier.
    When the installation finishes, the current shell still holds the prompt. I need to press ENTER to get out. The problem If I integrate them with this tools their flow does not end up, as command prompt does not return. In addition to that I need the returned execution status (echo $?) for evaluating the process.
    I have tried launching it in background but did not work, any ideas ?
    They say, silent does not require user interaction still we have to press ENTER to exit the console (silent + GUI).
    Please suggest.
    Thanks in advance,
    Bhaskar
    I am posting one of the application installation output to give a better idea(Oracle Webtier Utilities):
    =========================================================
    bash-3.2$ ./runInstaller -silent -responseFile /sarbackups1/infra_build/response/WebtierSOA_InstallOnly_11.1.1.4.rsp &
    [1] 17055
    -bash-3.2$ Starting Oracle Universal Installer...
    Checking Temp space: must be greater than 80 MB. Actual 3578 MB Passed
    Checking swap space: must be greater than 500 MB. Actual 28991 MB Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-02-21_04-40-33PM. Please wait ..../runInstaller: syntax error at line 299: `count1=$' unexpected
    Log: /u01/app/oracle/oraInventory/logs/install2012-02-21_04-40-33PM.log
    Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
    Reading response file..
    Expected result: One of 5.9,5.10
    Actual Result: 5.10
    Check complete. The overall result of this check is: Passed
    CertifiedVersions Check: Success.
    Checking for SUNWarc; found Lint Libraries (usr)(SUNWarc). Passed
    Checking for SUNWbtool; found CCS tools bundled with SunOS(SUNWbtool). Passed
    Checking for SUNWhea; found SunOS Header Files(SUNWhea). Passed
    Checking for SUNWlibC; found Sun Workshop Compilers Bundled libC(SUNWlibC). Passed
    Checking for SUNWlibm; found Math & Microtasking Library Headers & Lint Files (Usr)(SUNWlibm). Passed
    Checking for SUNWlibms; found Math & Microtasking Libraries (Usr)(SUNWlibms). Passed
    Checking for SUNWsprot; found Solaris Bundled tools(SUNWsprot). Passed
    Checking for SUNWtoo; found Programming Tools(SUNWtoo). Passed
    Checking for SUNWi1of; found ISO-8859-1 (Latin-1) Optional Fonts(SUNWi1of). Passed
    Checking for SUNWi1cs; found X11 ISO8859-1 Codeset Support(SUNWi1cs). Passed
    Checking for SUNWi15cs; found X11 ISO8859-15 Codeset Support(SUNWi15cs). Passed
    Checking for SUNWxwfnt; found X Window System platform required fonts(SUNWxwfnt). Passed
    Check complete. The overall result of this check is: Passed
    Packages Check: Success.
    Checking for 127111-02; found 127127-11. Passed
    Checking for 137111-04; found 137137-09. Passed
    Check complete. The overall result of this check is: Passed
    Patches Check: Success.
    Expected result: 1024MB
    Actual Result: 16384MB
    Check complete. The overall result of this check is: Passed
    TotalMemory Check: Success.
    Verifying data......
    Copying Files...
    -----------20%----------40%----------60%----------80%--------100%
    Applying Oneoff Patch...
    [CONFIG] Launching Config Actions....
    Started Configuration:Web Tier Configuration
    [CONFIG]:Create and Start AS Instance (Web_PIT3)
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Creating Oracle Instance directories...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Recording OPMN ports reservations...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Bootstrapping OPMN configuration files...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Instantiating opmnctl for direct usage...
    [CONFIG] [Web Tier Configuration] [Create and Start AS Instance (Web_PIT3)]:Skipping instance registration
    [CONFIG] SUCCESS:Create and Start AS Instance (Web_PIT3)
    [CONFIG]:Create and Start OHS Component (ohs_PIT3)
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Creating empty component directories...
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Provisioning OHS files for ohs_PIT3
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Copying OHS files from ORACLE_HOME to ORACLE_INSTANCE locations
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Customizing httpd.conf
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Adding component's process control to OPMN...
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Skipping ohs_PIT3 component registration.
    [CONFIG] [Web Tier Configuration] [Create and Start OHS Component (ohs_PIT3)]:Invoking opmn reload...
    [CONFIG] SUCCESS:Create and Start OHS Component (ohs_PIT3)
    [CONFIG]:Create and Start Web Cache Component (webcache_PIT3)
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Creating empty component directories...
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Provisioning WebCache files for webcache_PIT3
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Copying WebCache files from ORACLE_HOME to ORACLE_INSTANCE locations
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Customizing webcache.xml
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Adding component's process control to OPMN...
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Skipping webcache_PIT3 component registration.
    [CONFIG] [Web Tier Configuration] [Create and Start Web Cache Component (webcache_PIT3)]:Invoking opmn reload...
    [CONFIG] SUCCESS:Create and Start Web Cache Component (webcache_PIT3)
    Configuration:Web Tier Configuration completed successfully
    The installation of Oracle AS Common Toplevel Component, Oracle WebTier and Utilities CD completed successfully.
    Prompt holds here I have to press ENTER to come out
    =========================================================

  • Using command prompt for help generating

    Hi all!
    Can I use command prompt for generating webhelp instead of
    RoboHelp HTML environment?
    thank you

    See this recent post.
    Click
    here.

  • OTD Developer Days-Getting a Command prompt in the Linux Shell for DD

    Hi,
    I've loaded the Virtual Machine (and all the files for Developer Days) and can launch the virtual machine from Windows 7...I get as far as the Linux shell showing that OTN Developer days is [running] in the VM, but I get no command prompt to login in..How do I a command prompt in this Linux shell? (thanks...I know this is a novice question..)
    Best Regards,
    Dave

    On many UNIX systems there's a utility called detach which will launch the following command in such a manner that killing the shell will not kill the process. On systems that lack this command, I'd find an open source implementation and install it.

  • Every time i try to open itunes to update apps for iphone 4s i can never get it to open, i went to command prompt and did the netsh winsock reset, still cannot open itunes

    i cannot open itunes to update apps on my iphone. i did the command prompt-netsh winsock reset, still cannot open itunes.

    Try following steps and test one at a time:
    1. Check to see if this file APSDaemon.exe is the problem here.
    Close your iTunes.
    Press Ctrl-Alt-Del key and choose Task Manager. In the "Processes" Tab, select the file APSDaemon.exe and click End Prosses button, then close the task manager window.
    Now open itunes and see if it is working?
    If that works, to prevent having to do the same process everytime you restart Windows, go to. START button, type in
    MSCONFIG
    Hit ENTER
    Click STARTUP Tab, Uncheck "Apple Push", click OK.
    Restart Windows.
    2. If that fails or you don't see ApsDaemon.exe in the Processes, refer to following article to remove SC files:
    http://support.apple.com/kb/TS2363
    3. If that fails, repair or reinstall your Quicktime. START / CONTROL PANEL / ADD N REMOVE PROGRAMS / hightlight QUICKTIME, click CHANGE or UNINSTALL then REPAIR.

  • How do i get a output in CSV of a SQL query executed via SQL Command prompt

    Hi All,
    I have a question with reference to SQL command prompt. I have a sql query which runs properly and gives proper execution in SQL Management console in GUI.
    This report is used to pull the free disk space report of our servers
    As i want to schedule it as a report so i want to script it to run via SQL command prompt. I made the script and it works fine if i enter it in SQL command prompt. When i try to extract the output to a CSV File it fails. Below is the details of the command
    i am using to query to pull the data. Can anyone help me in getting the output of this query in SQL command prompt.
    sqlcmd -W -s , -S Servers FQDN
    use operationsmanager
    Go
    Query:"select Path, InstanceName, SampleValue 
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled" -s "," -o "C:\DataSqlCmd.csv"
    Go
    When i enter the command without the quotes when the query is starting and ending and also without the output command (-s "," -o "C:\DataSqlCmd.csv") it is working and shows the output in the command prompt. Below is the screen shot for
    your reference.
    Due to security reasons i have to erase the server names:
    But when i add the line to extract the output ( -s "," -o "C:\DataSqlCmd.csv") It gives me this error:
    The exact command would be:
    sqlcmd -W -s , -S CINMLVSCOM01.e2klab.ge.com
    use operationsmanager
    Go
    "select Path, InstanceName, SampleValue 
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled" -s "," -o "C:\DataSqlCmd.csv" -h-1
    Go
    saying the syntax is not correct or some thing as per the below screenshot.
    Can any one please help. Below is just the query whi i use to get the output in SQL management studio.
    Can any one make a command for the below quer so i can directly execute and test for getting the output.
    select Path, InstanceName, SampleValue 
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled
    Gautam.75801

    Can you try the below query?
    select Path, InstanceName, SampleValue
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < 20 and CounterName like '% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled
    -- replace the below query part in the below SQLCMD C:\>SQLCMD -S SERVERNAME -E -d operationsmanager -Q "select * from sys.databases ds with (nolock) where name='master'" -s "," -o "F:\PowerSQL\MyData.csv" -h -1
    SQLCMD -S SERVERNAME -E -d OperationsManager -Q "select Path, InstanceName, SampleValue
    from PerformanceDataAllView pdv with (NOLOCK)
    inner join PerformanceCounterView pcv on pdv.performancesourceinternalid = pcv.performancesourceinternalid
    inner join BaseManagedEntity bme on pcv.ManagedEntityId = bme.BaseManagedEntityId
    where SampleValue < '20' and CounterName='% Free Space' and TimeSampled > '2014-08-06 11:00:00.00'
    order by countername, timesampled" -s "," -o "c:\MyData.csv" -h -1
    Refer for the other ways 
    http://dba.stackexchange.com/questions/23566/writing-select-result-to-a-csv-file
    --Prashanth

Maybe you are looking for

  • Need help with publishing as animated .gif

    I'm having trouble publishing my project as an animated .gif.  My project, which consists of two different animated movie clips, plays just fine when test it (Shift + Enter).  But, when I go to publish it, the animations don't show up.  The settings

  • How to fill the master data in ecc

    Hi,          0product_attr having zero records i ecc,how to fill the master data in ecc can you pls provide me the setps? Regrads, devi.

  • How to restore volume on my iPhone 4S?

    I can't  lisen to music or videos, volume buttons not working.

  • The Sims 2

    Hello, I have this game for my pc, and want to install it on my macbook pro, but i know i wont let me because its not universal, is there a program to bypass that and install the game

  • Problem reading Attachments

    I do not know if this belongs here. Has anybody experience regarding Mac OS X 10.5.5/10.5.6 & Entourage. Every time we received an email with a pdf attachment that are created from any adobe products. The Entourage will completely freezes and hangs I