How to run a WMI query to get an element of a class?

Hello everyone,
I am trying to run a PowerShell Query to get the value of a certain element inside a class instance. How can I accomplish this?
I tried this...
PS C:\windows\system32> Get-WmiObject DCIM_BIOSPassword -Namespace ROOT\DCIM\SYSMAN | Select AttributeName,IsSet
AttributeName                                                                 IsSet
AdminPwd                                                                       True
SystemPwd                                                                     False
and I get the result of both instances; (Because there are two instances inside the class!) I want the result of just one instance.
Thank you very much in advance.

This is the result I get;
PS C:\windows\system32> Get-WmiObject DCIM_BIOSPassword -Namespace ROOT\DCIM\SYSMAN | Get-Member
TypeName: System.Management.ManagementObject#ROOT\DCIM\SYSMAN\DCIM_BIOSPassword
Name MemberType Definition
PSComputerName AliasProperty PSComputerName = __SERVER
AttributeName Property string AttributeName {get;set;}
Caption Property string Caption {get;set;}
CurrentValue Property string[] CurrentValue {get;set;}
DefaultValue Property string[] DefaultValue {get;set;}
Description Property string Description {get;set;}
ElementName Property string ElementName {get;set;}
InstanceID Property string InstanceID {get;set;}
IsOrderedList Property bool IsOrderedList {get;set;}
IsReadOnly Property bool IsReadOnly {get;set;}
IsSet Property bool IsSet {get;set;}
MaxLength Property uint64 MaxLength {get;set;}
MinLength Property uint64 MinLength {get;set;}
PasswordEncoding Property uint32 PasswordEncoding {get;set;}
PendingValue Property string[] PendingValue {get;set;}
__CLASS Property string __CLASS {get;set;}
__DERIVATION Property string[] __DERIVATION {get;set;}
__DYNASTY Property string __DYNASTY {get;set;}
__GENUS Property int __GENUS {get;set;}
__NAMESPACE Property string __NAMESPACE {get;set;}
__PATH Property string __PATH {get;set;}
__PROPERTY_COUNT Property int __PROPERTY_COUNT {get;set;}
__RELPATH Property string __RELPATH {get;set;}
__SERVER Property string __SERVER {get;set;}
__SUPERCLASS Property string __SUPERCLASS {get;set;}
ConvertFromDateTime ScriptMethod System.Object ConvertFromDateTime();
ConvertToDateTime ScriptMethod System.Object ConvertToDateTime();
But this is not it. I want to get the value of "IsSet" for AdminPwd only.

Similar Messages

  • Operations manager failed to run a wmi query for wmi events (0x800706ba)

    Hi everyone,
    I've been working on this issue for a while and I am still no closer to finding out what the problem is.  If anybody can offer any other advice or things to check, I'm all ears.
    I'm running SCOM 2012 R2 with UR2, and the Cluster Management Pack v6.0.7063.0
    My problem is on one particular batch of cluster servers where I am getting the following error.
    Name: Operations Manager failed to run a WMI query for WMI events
    Alert Description:
    Module was unable to enumerate the WMI data
    Error: 0x800706ba
    Details: The RPC server is unavailable
    Workflow name: Microsoft.Windows.Cluster.Node.StateMonitoring
    Instance Name: servername.domain.local
    Instance ID: {instance_id}
    Management group: SCOM_Management_Grp_Name
    I am getting this alert regardless of whether I run the Windows Cluster Action Account as Local System, or as a domain user with full local admin privileges on all the cluster nodes.
    When looking at the management pack and the workflow in particular (Microsoft.Windows.Cluster.Node.StateMonitoring), I can see that it's trying to access
    MSCluster_Node in the root\MSCLUSTER WMI namespace.
    This is the workflow for your information...
    <UnitMonitor> ID="Microsoft.Windows.Cluster.Node.StateMonitoring" Accessibility="Public" Enabled="onEssentialMonitoring" Target="ClusLibrary!Microsoft.Windows.Cluster.Node" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="ClusLibrary!Microsoft.Windows.Cluster.CheckState" ConfirmDelivery="false">
    <Category>AvailabilityHealth</Category>
    <AlertSettings AlertMessage="Microsoft.Windows.Cluster.Node.StateMonitoring.AlertMessage">
    <AlertOnState>Warning</AlertOnState>
    <AutoResolve>true</AutoResolve>
    <AlertPriority>Normal</AlertPriority>
    <AlertSeverity>MatchMonitorHealth</AlertSeverity>
    <AlertParameters>
    <AlertParameter1>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
    <AlertParameter2>$Target/Property[Type="ClusLibrary!Microsoft.Windows.Cluster.Node"]/ClusterName$</AlertParameter2>
    </AlertParameters>
    </AlertSettings>
    <OperationalStates>
    <OperationalState ID="Success" MonitorTypeStateID="Online" HealthState="Success" />
    <OperationalState ID="Warning" MonitorTypeStateID="Partial" HealthState="Warning" />
    <OperationalState ID="Error" MonitorTypeStateID="NotOnline" HealthState="Error" />
    </OperationalStates>
    <Configuration>
    <ClusterObjectName>$Target/Property[Type='ClusLibrary!Microsoft.Windows.Cluster.Node']/NodeName$</ClusterObjectName>
    <PollInterval>60</PollInterval>
    <ClusterObjectClass>MSCLUSTER_Node</ClusterObjectClass>
    <OnlineExpression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </OnlineExpression>
    <OnlineExpressionOnDemand>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </OnlineExpressionOnDemand>
    <PartialExpression>
    <Or>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </Or>
    </PartialExpression>
    <PartialExpressionOnDemand>
    <Or>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>Equal</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </Or>
    </PartialExpressionOnDemand>
    <NotOnlineExpression>
    <And>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='EventNewState']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </And>
    </NotOnlineExpression>
    <NotOnlineExpressionOnDemand>
    <And>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">0</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">2</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <XPathQuery Type="String">Property[@Name='State']</XPathQuery>
    </ValueExpression>
    <Operator>NotEqual</Operator>
    <ValueExpression>
    <Value Type="String">3</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </And>
    </NotOnlineExpressionOnDemand>
    <WMIFields>Name, State</WMIFields>
    </Configuration>
    </UnitMonitor>
    I can confirm that I am able to browse the MSCluster_Node class locally, as well as remotely using WMIEXPLORER and WBEMTEST,
    however it only works when I set the Authentication Level to
    Packet Privacy.  If I do not select Packet Privacy, a WMI event log error 5605 is logged on the remote servers application log that says...
    The root\mscluster namespace is marked with the RequiresEncryption flag.  Access to this namespace might be denied if the script or application does not have the appropriate authentication level.  Change the authentication level to Pkt_Privacy
    and run the script or application again.
    I can confirm that all firewalls are turned off, and there are no firewalls between the management servers and the agents in question.  AV exclusions have been done and appear to be in place.  The nodes are all Windows 2008 R2 with SP1.  As
    far as I can tell there is plenty of memory available on each of the nodes in question (50%+) of RAM is available. 
    If I manually run the "Discover the Windows Server 2008 R2 Cluster Components" task in the Cluster Service State section of the management pack in the Monitoring Pane in the console, on the nodes in question - the discovery runs successfully.
    Does anybody have any other ideas or suggestions I could try?
    Many thanks in advance,
    Noel.
    http://www.dreamension.net

    Hi,
    Common causes of RPC errors include:
    Errors resolving a DNS or NetBIOS name.
    The RPC service or related services may not be running.
    Problems with network connectivity.
    File and printer sharing is not enabled.
    For more information, please review the link below:
    Windows Server Troubleshooting: "The RPC server is unavailable"
    http://social.technet.microsoft.com/wiki/contents/articles/4494.windows-server-troubleshooting-the-rpc-server-is-unavailable.aspx#Identify
    Troubleshooting RPC Errors
    http://technet.microsoft.com/en-us/magazine/2007.07.howitworks.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Alert: Operations Manager failed to run a WMI query

    I am having an issue with my Cluster MP. I am getting a large amount of alerts for "Alert: Operations Manager failed to run a WMI query"
    Alert: Operations Manager failed to run a WMI query for WMI events
    Source: Server.Domain
    Path: Server.Domain
    Last modified by: System
    Last modified time: 6/10/2014 5:20:40 PM Alert description: Module was unable to execute the notification query.
    Error: 0x80041003
    Details: Access denied
    One or more workflows were affected by this.
    Workflow name: Microsoft.Windows.Cluster.Node.StateMonitoring
    Instance name: Server.Domain
    Instance ID: {A7DED311-01E2-927A-A4BF-013D443EBA84}
    Management group: SCOM-GroupName
    This happens for many workflows. I can not for the life of me find what access is being denied on. Any help would be great.
    I have the cluster run-as profile configured to use a domain account as well as the local agent to use a domain account that has administrative rights to the clusters.
    Thanks,
    Seth

    Yes, in a last ditch effort to over come this access denied I made my Action Account a domain admin and configured the agent default account from local system to the domain action account. nothing has worked for me.

  • Operations Manager failed to run a WMI query-Invalid class

    Hi Team,
    may of the windows 2008 R2 sp1 and sp2 servers getting below SCOM 2012 alert. Please help me to fix the same.
    SCOM version : SCOM 2012 R2
    Alert: Operations Manager failed to run a WMI query
    Source: server Name
    Path: server Name
    Last modified by: System
    Last modified time: 2/6/2014 8:33:22 AM
    Alert description: Object enumeration failed
    Query: 'SELECT * FROM MetaFrame_Server WHERE ServerName="server Name"'
    HRESULT: 0x80041010
    Details: Invalid class
    One or more workflows were affected by this.
    Workflow name: Citrix.PresentationServer.ActiveSessions.PerformanceMonitor

    First try it with WBEMTEST to see what is going with the WMI class. The error you are getting usually means WMI misses that class and you should load the mof again/ maybe rebuild the entire repository (careful as the windows files are all located
    on 1 folder, but applications tend to store it in their own folders, like citrix, ibm, etc).
    Try to run this command:
    mofcomp "<Programfiles>\Citrix\System32\Citrix\WMI\ .Mof file for citrix"
    {citrixProv.XP10FR3.mof, metaframeProv.XP10FR3.mof, and mgmt.XP10FR4.mof files}
    Then, run the WBEMTest again and the namespace should be returned successfully. Then restarting the health service on agent.
    Also you can refer below link
    https://support.citrix.com/article/CTX122283
    Please remember, if you see a post that helped you please click (Vote As Helpful) and if it answered your question, please click (Mark As Answer).

  • Operations Manager failed to run a WMI query -Access Denied

    v hosts to 2012 r2, and now we're seeing a lot of "Operations Manager failed to run a WMI Query", With "Object enumeration failed".
    Query: 'SELECT Name, State FROM MSCLUSTER_NetworkInterface where Name="our host name
    - Management"' HRESULT: 0x80070005 Details: Access is denied.
    Our Cluster run-as account is local admin on the hosts beeing monitored.
    We've tried rebuilding the WMI database following this procedure:
    1. Disable and stop the WMI service.
         sc config winmgmt start= disabled
         net stop winmgmt
    2. Run the following commands.
         Winmgmt /salvagerepository %windir%\System32\wbem      (I noticed that you have run this command, but I would suggest
    that you try it again)
         Winmgmt /resetrepository %windir%\System32\wbem
    4. Re-enable the WMI service and then reboot the server to see how it goes.
         sc config winmgmt start= auto
    If the problem remains, then try the following steps to rebuild the repository:
    1. Disable and stop the WMI service.
         sc config winmgmt start= disabled     (note that there is a blank between '=' and 'disabled')
         net stop winmgmt
    2. Rename the repository folder (located at %windir%\System32\wbem\repository) to repository.old.
    3. Re-enable the WMI service.
         sc config winmgmt start= auto
    4. Reboot the server to see if the problem remains.
    but we've had no Luck so far. Any help would be
    appreciated!
    Regards,
    Torbjørn

    Have you checked if DCOM is enabled, WMI will not be able to connect if its disabled.
    Use the steps below to configure DCOM.
    Run dcomcnfg.exe
    Double-click Component Services
    Double-click Computers
    Right-click My Computer
    Select Properties
    Select Default Properties tab
    Ensure the "Enable Distributed COM on this computer" checkbox is checked
    Default Authentication Level: Connect
    Default Impersonation Level: Identify
    Next:
    Click on COM Security tab
    Click Edit Limits under "Launch and Acitvate Permissions"
    Make sure Remote Launch and Activation permissions are enabled for the Administrators group
    Hope this helps
    -Adrian

  • How to run a search query for a particular folder in KM related to portal

    Hi,
    Can any one tell me the steps for : how to run a search query for a particular folder in knowledge management related to portal.
    Answers will be rewarded.
    Thanks in advance.
    KN
    Edited by: KN on Mar 18, 2008 6:33 AM

    Ok u may not require a coding
    But u req configuration
    U should first make a search option set
    Link: [Search Option set|http://help.sap.com/saphelp_nw04/helpdata/en/cc/f4e77ddef1244380b06fee5f8b892a/frameset.htm]
    Then u need 2 duplicate a KM Command by the name Search From here
    and customize it to include the Search Option that u have created
    Link: [Search from here|http://help.sap.com/saphelp_nw04/helpdata/en/2a/4ff640365d8566e10000000a1550b0/frameset.htm]
    Then in the layout add this command.
    Regards
    BP

  • How to Run a Select Query  stored in a Variable

    Hello,
    I have a following requirement:
    Result of one select query on Var1 , result of other select query in Var2 ,
    if Va2 = 'value11' OR Var2 = 'Value2' then Var1 = 'select query'. Now how can I run this SQL query at the end of the Pl/SQL?
    so I'm writing following query for the same:
    DECLARE
    qry nvarchar2(500);
    result nvarchar2(500);
    BEGIN
    select 'select TEXTVAL as "CHARG" FROM TABLE1 WHERE LOC =''[ParameterValue]'' and KEYNAME =''<<REPLACE>>''' INTO qry from dual;
    SELECT CASE WHEN count(RW."CountofBATCH") > 1 then 'Mixing'
    WHEN count(RW."CountofMAT") = 0 then 'None'
    ELSE 'Other'
    END
    INTO result
    FROM TABLENAME2 TT, XMLTable('/Rowsets/Rowset/Row' PASSING TT.XMLCOL
    COLUMNS
    "CountofBATCH" PATH '/Row[CLABS > 0]/CHARG',
    "CountofMAT" PATH '/Row[MATNR = "[Parameter Value]"]/MAT'
    ) AS RW
    where
    TT.PL = '[Parameter Value]' and
    TT.TANK = '[Parametr Value]' ;
    IF result = 'Mixing' OR result = 'None' THEN
    qry := replace( qry , '<<REPLACE>> ' , result);
    else
    qry := 'Nothing';
    END IF;
    This way the variable qry will have select statement. Now How can I run this qry variable to get the output of that select statement in the same query?

    you can use execute immediate if the output of the query is in the single query.
    that is very simple.
    have the query in the signle string and then pass like this
    declare
    qry varchar2(255);
    result varcharf2(2500);
    vempid number :=1;
    begin
    qry:='select empname from emp where empid=:empid';
    execute immediate qry into result using vempid;
    -----now the data result is in result
    end;

  • How to run recordset SQL query in FORM DATA event

    How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?

    Hi Slamet,
    When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
    With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
    There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
    <i>The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.</i>
    Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
    Hope it helps
    Trinidad.

  • How to run an update query on results from a spreadsheet

    Hey there,
    I am new to this kinda thing.
    I received a spreadsheet that has 2 tabs, 1 is called SQL Results, and has a ton of data. 1 is called SQL Statement and has a select statement in the first cell.
    I was told to run an update query using the spreadsheet, and was given this:
    = CONCATENATE("Update CARDMEMBERISSUE set CURRSTATUSCD = 'ACT', DATELASTMAINT = sysdate where AGREENBR = ",A2," and MEMBERNBR = ",B2," and ISSUENBR = ",C2,";")
    = CONCATENATE("Insert into CARDMEMBERISSUEHIST (AGREENBR, MEMBERNBR, ISSUENBR, EFFDATETIME, CARDSTATCD, STATREASON, DATELASTMAINT, DATESENT) values (",A2,",",B2,",",C2,",sysdate,'ACT',null,sysdate,null);"
    I am not sure what to do or how to run this.
    This is the what the lines in the spreadsheet look like, including column header, A1 is blank.
    A B C etc
         AGREE NBR      MEMBERNBR ISSUE NBR CURRSTATUSCD PREFIX CARD NBR AGREETYPCD OWNER PERS NBR     EXT CARD      ISSUE DATE     
    2     12          1     44     ISS g     22 22 19/10/2011

    The =concatenate bits are Excel formulae. Assuming they correctly written, they will generate a set of individual sql statements. The first concaenatewill generate a set of update statements against the CardMemberIssue table, and the seond will generate a set of insert statement to the CardMemberIssueHist table.
    You should be able to just paste the generated statements into whatever tool you are using to run sql to execute them. Before you do that though, make sure that you issue:
    alter session set cursor_sharing=force;before pasting anything in.
    john

  • How to run commands like "ipconfig" and get the output in adobe AIR in windows?

    import flash.desktop.NativeProcess; 
    import flash.desktop.NativeProcessStartupInfo;   
    if (NativeProcess.isSupported) {     
         var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();     
         var processpath:File = File.applicationDirectory.resolvePath("MyApplication.whatever");     
         var process:NativeProcess = new NativeProcess();       
         npsi.executable = processpath;     
         process.start(npsi); 
    The above can only run a sub-application, but how to run an independent  application(command) like ipconfig and get the result?

    Hi,
    here is an example of running a net Use command line from AIR, unig the new NativeProcess. Hope it will help !
    function launchProcess()
      var file = air.File.applicationDirectory;
      // set command path
      file = file.resolvePath("C:/Windows/system32/net.exe");
      var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
      nativeProcessStartupInfo.executable = file;
      // prepare command parameters
      var args = new runtime.Vector["<String>"]();
      args.push('USE');
      args.push('W:');
      args.push('/delete');
      args.push('/y');
      // set arguments
      nativeProcessStartupInfo.arguments = args;
      // add listeners to catch command outputs
      process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
      process.addEventListener(air.ProgressEvent.STANDARD_ERROR_DATA, onErrorData);
      process.addEventListener(air.NativeProcessExitEvent.EXIT, onExit);
      // create and run Native process
      process = new air.NativeProcess();
      process.start(nativeProcessStartupInfo);
    function onOutputData(ProgressEvent)
      var processResults = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable);
      air.trace("Results: \n" + processResults);
    function onErrorData(ProgressEvent)
      var processResults = process.standardError.readUTFBytes(process.standardError.bytesAvailable);
      if(processResults.search('password') > -1){
        window.alert('Bad password');
      air.trace("Errors: \n" + processResults);
    function onExit(NativeProcessExitEvent)
      air.trace("Process ended with code: " + NativeProcessExitEvent.exitCode);

  • How to run a BI query from SSM

    HI,
    My client would like to drill down to a BI query where the starting point is a KPI.
    For eg, we have a KPI "Turnover". When we are at kpi detailed level for a specific period, we would like to run a query to have detailed information for turnover (we dont want to use report functionnality of SSM).
    We are using SSM 7.5 and BW queries as data provider.
    Is there a way to achieve this ? (web service ? )
    Thanks in adavnce

    Jacques,
    You cannot run a BI Query from the end user interface of SSM. Your alternatives are to create an associated report inside SSM or use an Associated Link in the KPI Details section.
    Right above the graphing on the KPI detail page there is the link Create Associated Report. SSM has some template reports and allows users to put together a report based on available SSM data.
    There is also the possibility of using Associated Links on the KPI detail page to point the user via a url to another reporting application, though it would not bring that data with it.
    Regards,
    Bob

  • How to run a simple shell comnd line on cygwin thru java class ?

    Hi
    I want to run a simple shell command "dir" on cygwin thru java class. My code is as follows :-
    public class CygJava {
         public static void main (String args[]){
              File workDir = new File("c:/cygwin/bin");
              try {
                   Runtime systemShell = Runtime.getRuntime();
                   Process shellOutput = systemShell.exec("dir", null, workDir);
                                                 InputStreamReader isr = new InputStreamReader(shellOutput.getInputStream());          
                   BufferedReader br = new BufferedReader (isr);
                   String line = null;
                   System.out.println("<OUTPUT>");
                   while((line = br.readLine()) != null ) {
                   System.out.println(line);
                   System.out.println("</OUTPUT>");
                   int exitVal = shellOutput.waitFor();
                   System.out.println("Process Exit Value : "+exitVal);
              }catch (IOException ioe) {
                   System.err.println(ioe);
              } catch (Throwable t) {
                   t.printStackTrace();
    On running this program , i get the error as :-
    java.io.IOException: CreateProcess: dir error=2
    Could anyone tell me as to why is this error occuring ?
    Thanks

    Hi guys,
    I am trying to launch a linux-environment application using cygwin from my java application.
    I already included the c:\cygwin path in the environment path of my computer, so if i run cygwin from windows console everything goes fine. But if i do the same from my java application, i get an error message:
    java.io.IOException: CreateProcess: cygwin error=2
         at java.lang.ProcessImpl.create(Native Method)
         at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
         at java.lang.ProcessImpl.start(ProcessImpl.java:30)
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
         at java.lang.Runtime.exec(Runtime.java:591)
         at java.lang.Runtime.exec(Runtime.java:429)
         at java.lang.Runtime.exec(Runtime.java:326)
         at prueba.Prueba.jButton1_actionPerformed(Prueba.java:94)
         at prueba.Prueba_jButton1_actionAdapter.actionPerformed(Prueba.java:151)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:5501)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
         at java.awt.Component.processEvent(Component.java:5266)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3968)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1778)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)I will appreciate a lot some help :)
    Thankx

  • How to run a sql query from a button in apex 3.0

    Hi,
    I am brand new and went through/installed the obe project tracker. I have need to create a simple application that displays a result (2 fields, name and license number) based on two parameters (dob and login id) which all are stored in 1 table in the database. I could this very simply in VB or VB.net but have no idea how to do it in apex.
    Please provide guidance,
    Thank you,
    Tom

    Hi Tom,
    Sounds like a report region will satisfy your requirements.
    Create a new report region on one of your pages.
    Choose SQL Report and give the region a title.
    When you get to the "Enter SQL Query or PL/SQL function returning a SQL Query:" step, type:
    SELECT name, license_number
    FROM   <insert_your_table_name_here>
    WHERE  dob = :P<n>_dob
    AND    login_id = :P<n>loginid(replace <n> with the page number that the region is on and use your own table name).
    Don't try to run the page yet - it will give 'No data found'
    Now, go back to the Page Definition screen and add two items in the region you just created - call them P<n>dob and P<n>login_id
    Then, create a button in the same region (to be displayed amongst the region's items) - call it P<n>_GO and click 'Create' (take all the other defaults).
    Now you can run the page, put some values into the fields and click go.
    If you want to get fancier, you can change the text items to select lists etc. - let us know if you need help with that.
    Hope this helps,
    Bryan.

  • How to run batch select query ?

    I have multiple "select" query .
    how do i run the query in a efficient way and absorp the values into an ArrayList ?
    addbatch() method is mainly used for "insert" kind of query .
    and also , it would be bad idea to run "select:" query one by one .
    can you tell whats the best use ?

    Are your queries related to each other, I mean, do you have something like
    select xpto from someTable where someValue = 1
    select xpto from someTable where someValue = 2
    select xpto from someTable where someValue = 3
    If it's something like this you can group
    select xpto from someTable where someValue in(1,2,3)
    If it is not I think there's no other way but running one at a time.
    mleiria

  • How to run a sql query (select) in parallel

    Hi All,
    I would like to do a select using the 8 cpus our production
    server has. My select is simple in just one table but its a big
    table (aprox. 10.000.000 rows) and I have to do a full scan in
    it. I know oracle does that, but how? do I put a clause in the
    select telling oracle to do the query in parallel? Has anyone
    done that, yet?
    Tks,
    Marcelo Lopes
    Rio de Janeiro - Brazil
    It's a hot sunny day today :)

    You could either include a parallel clause in the table
    definition or alter the tble to include parallelism, or put a hint
    on the SQL ..
    alter table my_table parallel (degree 16);
    or
    select /*+ parallel(my_table, 16) */ ...

Maybe you are looking for

  • WebLogicServer BEA-000337 ExecuteThread: '11' for queue: 'weblogic.kernel.Default' has been busy for "698" seconds working on the request

    Hi, When I invoke this JSP, the servlet gets the request and sends a reply, but the JSP never finishes. The connection isn't dropped, the browser icon keeps spinning, as if it is still trying to load the page. But nothing ever happens. After more tha

  • IPhoto 11 doesn't load my old photo library

    I have an old iphoto library and my new iphoto 11 allows me to locate and load the 1.5 GB file, but when it loads there ia nothing? No events or photos? The library doesn't upgrading, so how do I load my old photos? Thanks Ant.

  • Reader 9.4.6 bug displaying PDFs from Autocad

    I've received several architectural drawings produced from Autocad as PDFs. All of them display correctly in Reader 9.4.6 for Windows, but in Reader 9.4.6 for Unix, some dashed lines are missing from the PDFs when viewed on the screen or printed. Whe

  • Long WPA password reconnect problem

    My iPod touch connects flawlessly to different known Wi-Fi networks when I move, but fails when coming back to a network where the password is particularly long (34 characters) : it asks for the passphrase as it had forgotten it. Though, powering the

  • Use of other graphics cards?

    I tried a trial of PPro CS5. I realize that only some cards will allow hardware acceleration. However, I was wondering if PPro CS5 will function with other cards but without hardware acceleration capabilities? My new machine has an Nvidia GTX 260 car