Executing windows executables with user Input / Output capabilities

Hi all,
I have a command that I can run on the DOS prompt with following output:
C:>runas /smartcard C:/WINDOWS/SYSTEM32/notepad.exe
Reading smart cards........
Using the card in reader 1.  Enter the PIN:
Attempting to start C:/WINDOWS/SYSTEM32/notepad.exe as user "MyCertificates DN Printed Here" ...Then notepad opens...viola.
Heres the problem I have doing this in Java. I do not know how to tell Java that while reading
the inputStream (of StreamGobbler type) to prompt me for the PIN like above. It just prints everything out above as if
it is text in my IDE.
Here is my code:
import java.io.*;
class StreamGobbler extends Thread
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type)
        this.is = is;
        this.type = type;
    public void run()
        try
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);
            String line=null;
            while ( (line = br.readLine()) != null)
                System.out.print(type + ">" + line);   
            } catch (IOException ioe)
                ioe.printStackTrace(); 
public class WinCmd {
      * @param args
     public static void main(String[] args) {
                    //cannot have space in front
                    //String adCmd = "cscript.exe C:\\mailEnable.vbs"; //works
                    //String adCmd = "C:/WINDOWS/SYSTEM32/ipconfig.exe"; //works
                    String adCmd = "runas /smartcard C:/WINDOWS/SYSTEM32/notepad.exe";
                        boolean success = false;
                        int exitVal = 1; //0 is success, so we default to a nonzero.
                       try
                           String osName = System.getProperty("os.name" );
                           String[] cmd = new String[3];
                           //specify file to use for NT, XP, and Vista
                           if( osName.equals( "Windows NT" ) || osName.equals( "Windows XP" ) || osName.equals( "Windows Vista" ) || osName.equals("Windows 2003") ){
                               cmd[0] = "cmd.exe";
                           else if ( osName.equals("Windows 95")){
                                cmd[0] = "command.com";
                           else {
                                System.out.println("Must execute from Windows 95, NT, XP, 2003, or Vista system.");
                               System.exit(1);
                           cmd[1] = " /C "; //tells os to terminate process when complete.
                           cmd[2] = adCmd;
                           String[] cmdOther = new String[1];
                           cmdOther[0] = "runas /smartcard";
                           //Execute process
                           //Process proc = Runtime.getRuntime().exec(cmd);
                           Process proc = Runtime.getRuntime().exec(adCmd, cmdOther);
                           // any error message / output?
                           StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");           
                           StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
                           //start output / error catching
                           errorGobbler.start();
                           outputGobbler.start();
                           // wait for process to finish and output exit value.
                           exitVal = proc.waitFor();
                           System.out.println("ExitValue: " + exitVal);
                           System.out.flush();
                           if (exitVal == 0) {
                                success = true;
                           else {
                                success = false;
                       } catch (Exception e) {
                           e.printStackTrace();
     } Here is output:
OUTPUT>Reading smart cards...Using the card in reader 1.  Enter the PIN:...
OUTPUT>
ExitValue: 1This output is what I see from my IDE, Elipse. Only difference is Java never prompted me to enter my PIN, it just output the "OUTPUT" stream as text...
ideas?
SK

Okay, made a little progress.
I created a new subClass called OutputGobbler that should be able to send the pin back to the inputStream of the Process object.
I also created a set / get bean for storing the pin. It all works up till it executes, then I get an ExitValue of 1.
What I think is happening is that the OutputGobbler IS writing the pin correctly...but its just not in the correct format for the
runas executable. This is because the exit value is 1, which means invalid function, which is usually caused by bad syntax.
Here is the updated code, I am posting entire code since much has changed. Output is below.
import java.io.*;
class StreamGobbler extends Thread
    InputStream is;
    String type;
    private String pin;
    StreamGobbler(InputStream is, String type)
        this.is = is;
        this.type = type;
        this.pin = "Hello";
    public String getPin () {
         return this.pin;
    public void setPin (String pin) {
          this.pin = pin;
    public void run()
         try
               String localPin = null;
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);
            String line=null;
            while ( (line = br.readLine()) != null) {
                 //try and find the request for PIN text in the output stream
                int idx = 0;
                idx = line.indexOf("Enter the PIN:");
                //if found prompt user for input.
                  if (idx != -1) { //-1 means no match found.
                       System.out.print("Enter the PIN:");
                       BufferedReader stdin = new BufferedReader( new InputStreamReader( System.in ) );
                       localPin = stdin.readLine();
                       System.out.println("Pin entered: " + localPin);
                       this.setPin(localPin);
                  //System.out.println(type + "--" + line);
        catch (IOException ioe)
          ioe.printStackTrace();
class OutputGobbler extends Thread
    String types;
    OutputStream os;
    String pin;
    OutputGobbler(OutputStream os, String types, String pin)
        this.os = os;
        this.types = types;
        this.pin = pin;
    public void run()
        try
            OutputStreamWriter osw = new OutputStreamWriter(os);
            BufferedWriter bw = new BufferedWriter(osw);
            bw.write(pin);
            bw.newLine();
        catch (Exception ioe)
          ioe.printStackTrace();
public class WinCmd {
      * @param args
     public static void main(String[] args) throws IOException {
                    //cannot have space in front
                    //String adCmd = "runas /smartcard C:/WINDOWS/SYSTEM32/notepad.exe";
                    String adCmd = "C:\\WINDOWS\\SYSTEM32\\runas.exe /smartcard C:\\WINDOWS\\SYSTEM32\\notepad.exe";
                        boolean success = false;
                        int exitVal = 1; //0 is success, so we default to a nonzero.
                       try
                           /*String osName = System.getProperty("os.name" );
                           String[] cmd = new String[3];
                           //specify file to use for NT, XP, and Vista
                           if( osName.equals( "Windows NT" ) || osName.equals( "Windows XP" ) || osName.equals( "Windows Vista" ) || osName.equals("Windows 2003") ){
                               cmd[0] = "cmd.exe";
                           else if ( osName.equals("Windows 95")){
                                cmd[0] = "command.com";
                           else {
                                System.out.println("Must execute from Windows 95, NT, XP, 2003, or Vista system.");
                               System.exit(1);
                           cmd[1] = " /C "; //tells os to terminate process when complete.
                           cmd[2] = adCmd;
                           String[] cmdOther = new String[1];
                           cmdOther[0] = "C:\\WINDOWS\\SYSTEM32\\runas.exe /smartcard";
                           //Execute process
                           //Process proc = Runtime.getRuntime().exec(cmd);
                           Process proc = Runtime.getRuntime().exec(adCmd, cmdOther);
                           // any error message / output?
                           StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");
                           StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
                           //start output / error catching and capture pin
                           errorGobbler.run();
                           outputGobbler.run();
                              //redirection pin to process
                              OutputGobbler oGobbler = new OutputGobbler(proc.getOutputStream(), "INPUT", outputGobbler.getPin());
                              System.out.println("Pin retrieved from getPin: " + outputGobbler.getPin());
                           oGobbler.run();
                           // wait for process to finish and output exit value.
                           exitVal = proc.waitFor();
                           System.out.println("ExitValue: " + exitVal);
                           System.out.flush();
                           if (exitVal == 0) {
                                success = true;
                           else {
                                success = false;
                       } catch (Exception e) {
                           e.printStackTrace();
}Output:
C:\Program Files\Java\jdk1.6.0_05\bin>java -cp "C:\MyJava" WinCmd
Enter the PIN:12345
Pin entered: 12345
Pin retrieved from getPin:12345
ExitValue: 1
C:\Program Files\Java\jdk1.6.0_05\bin>So it seems I can pass the pin between Thread objects successfully. But I do not know how to pass the Operating system the correct
format.
Currently I'm trying "bw.write(pin)" hoping that the pin (as String type) will be put in the correct format, but it is not.
I also tried:
bw.write(pin);
bw.newline();
also
bw.write(pin.toCharArray());
bw.newline();
All give same error of ExitValue 1.
Frustration is setting in...
SK

Similar Messages

  • Partition failed with error input output

    Hi All,
    I installed a new hard drive (WD 500G) into my 2006 Macbook, Mac OS X 10.4.10.  I also increased the RAM to 2G.  My Macbook reconized the hard drive. However, I followed the steps below to format the HD, but got the partition failed with error input output msg.
    1. Went to  Disk Utility, selected the name of new hard drive in the sidebar.
    2. Select the Partition tab, and selected 1 partition from the drop down menu.
    3. Click Options, then choose GUID .
    4. Select Partition
    In previous posts someone suggested updating the softward to 10.4.11 or the erasing the HD, but erasing the hard drive would take 13 hours according to my Macbook.  Any suggestions?  Please Help!

    The error usually means the drive is bad. But you can try this:
    Erase and Install OS X
    1. Boot from your OS X Installer Disc. After the installer loads select your language and click on the Continue button.  When the menu bar appears select Disk Utility from the Utilities menu.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area.  If it does not say "Verified" then the drive is failing or has failed and will need replacing.  SMART info will not be reported  on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.
    7. After formatting has finished quit DU and return to the installer. Install OS X.

  • I'm using my electric guitar with GarageBand. With the input/output jack being full of my guitar cord, does anyone know if I can rig a BlueTooth speaker for output? Thanks in advance for any response.

    I'm using my electric guitar with GarageBand. With the input/output jack being full of my guitar cord, does anyone know if I can rig a BlueTooth™ speaker for output? Thanks in advance for any response.

    yes this will work
    you can also get a splitter cable that goes in to your in/out port so you can have 2 (or more) separate ports

  • Producer Consumer & User Events with user input windows

    Hello All,
    I am planning to build Labview code using the Producer Consumer & User events pattern, the application needs multiple user input windows for things like personal data, feature selection etc, there could be around 15 or 20 distincts screen/panels required.
    The main question from me is... Is there a best practive approach to navigating/loading from one window to another etc, and also providing a way to to retrun to the previous window.
    Also I may need need to be running some slow logging and control hardware in the background while navigating some of the screens, this seems like the producer consumer vi will be running in the background while the user input causes a load/display window event.
    A simple Producer Consumer multiple winjdoow example would be very welcome. Thanks.
    Regards Chris

    I will second Mike's suggestion to use a central VI with subpanel(s).  It is usually less confusing than multiple windows.  Typically, the selection/navigation mechanism is on the left of the main panel, global info (like help) on the right, and the subpanel(s) in the center.
    The advantage of subpanels/subVIs is that you can launch your subVIs and keep them active in the background, even though they are not being used.  This means they will keep their state information and load into the subpanel almost instantaneously the next time you need them.  For a short tutorial on subpanels, check out this link.  Scroll down to the fourth reply for working code.  The original code posted is broken.
    Communication between your VIs or loops is typically done with either queues or event structures.  State information in each should be shift registers in the respective VIs.  If you have the time, I would highly recommend you learn how to use LabVIEW classes.  The command pattern is tailor made for this kind of application.
    Finally, avoid global data if you can.  Global data is anything that you can get to from anywhere (globals, functional globals, etc.).  Use of these can speed your development, but can also lead to sloppy design which will cause you major problems later.  If you really need globally available data, use a data value reference.  It is unnamed and requires a reference, which tends to enforce better programming practice.  Yes, there are instances where you truly need globally available, named data, but they are fairly rare.  You should only use them if you are experienced and really know what you are doing.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Cost center query tkakes a long time while executing with User's Id

    Hi Experts,
    We have a cost-center query which is taking a long time to display the output with User's id.
    I tried running the report with the same selections and was able to get the values within seconds.
    Also we have maintained aggregates on the cube.
    When user tries it for a single cost-center the performance is Ok.
    Any help on this wil be highly appreciated.
    Thanks,
    Amit

    Hi,
    while running the query find the trace in ST05 - before running the query in RSRT activate the trace with user id and after seeing the report in RSRT deactivate the trace.
    go through the logs find the which object taking long time then create the aggregates on the cube.
    while creating agggates give the fixed value.
    please find the doc " how to find the SQL traces in sap bi"
    Thanks,
    Phani.

  • Calling report from a form with user input parameters

    Hello,
    I am new to Oracle reports. I have an application coded in 6i. I am currently running the application in Oracle Forms Builder 9i. There are also few reports which are called from the forms. Since the application was developed in 6i, the report was called using Run_Product. The forms pass a set of user parameters to the report using the parameter list pl_id. The syntax used was Run_Product(REPORTS, 'D:\Report\sales.rdf', SYNCHRONOUS, RUNTIME,FILESYSTEM, pl_id, NULL);
    I learnt that the Run_product doesnt work in 9i and we need to use run_report_object. I have changed the code to use run_report_object and using web.show_document () i am able to run the report from the form. There are 2 parameters that need to be passed from forms to reports. The parameters are from_date and to_date which the user will be prompted to enter on running the form. In the report, the initial values for these parametes are defined. So, the report runs fine for the initial value always. But when i try to change the user inputs for the form_date and to_date, the report output doesnt seem to take the new values, instead the old report with the initial values(defined in the report) runs again.
    Can someone give me the code to pass the user defined parameters to the report from the forms? I have defined a report object in the forms node as REPTEST and defined a parameter list pl_id and added form_date and to_date to pl_id and used the following coding:
    vrepid := FIND_REPORT_OBJECT ('REPTEST');
    vrep := RUN_REPORT_OBJECT (vrepid,pl_id);
    But this doesnt work.
    Also, Should the parameters defined in the forms and reports have the same name?

    Thanks for the quick response Denis.
    I had referred to the document link before and tried using the RUN_REPORT_OBJECT_PROC procedure and ENCODE functions as given in the doc and added the following SET_REPORT_OBJECT_PROPERTY in the RUN_REPORT_OBJECT_PROC :
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,' FROM_DATE='||:BLK_INPUT.FROM_DATE||' TO_DATE='||:BLK_INPUT.TO_DATE||' paramform=no');
    But this also dint work. Please help me understand what difference does setting paramform=no OR paramform=yes make?
    In the report, i have defined the user parameters as FROM_DATE and TO_DATE respectively so that they match the form datablock BLK_INPUT items FROM_DATE and TO_DATE.
    My WHEN_BUTTON_PRESSED trigger is as below:
    DECLARE
    report_id report_object;
    vrep VARCHAR2 (100);
    v_show_document VARCHAR2 (2000) := '/reports/rwservlet?';
    v_connect VARCHAR2 (30) := '&userid=scott/tiger@oracle';
    v_report_server VARCHAR2 (30) := 'repserver90';
    BEGIN
    report_id:= find_report_object('REPTEST');
    -- Call the generic PL/SQL procedure to run the Reports
    RUN_REPORT_OBJECT_PROC( report_id,'repserver90','PDF',CACHE,'D:\Report\sales.rdf','paramform=no','/reports/rwservlet');
    END;
    ... and the SET_REPORT_OBJECT_PROPERTY code in the RUN_REPORT_OBJECT_PROC procedure is as:
    PROCEDURE RUN_REPORT_OBJECT_PROC(
    report_id REPORT_OBJECT,
    report_server_name VARCHAR2,
    report_format VARCHAR2,
    report_destype_name NUMBER,
    report_file_name VARCHAR2,
    report_otherparam VARCHAR2,
    reports_servlet VARCHAR2) IS
    report_message VARCHAR2(100) :='';
    rep_status VARCHAR2(100) :='';
    vjob_id VARCHAR2(4000) :='';
    hidden_action VARCHAR2(2000) :='';
    v_report_other VARCHAR2(4000) :='';
    i number (5);
    c char;
    c_old char;
    c_new char;
    BEGIN
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,report_file_name);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,report_server_name);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,report_destype_name);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,report_format);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,' FROM_DATE='||:BLK_INPUT.FROM_DATE||' TO_DATE='||:BLK_INPUT.TO_DATE||' paramform=no');
    hidden_action := hidden_action ||'&report='||GET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME);
    hidden_action := hidden_action||'&destype='||GET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE);
    hidden_action := hidden_action||'&desformat='||GET_REPORT_OBJECT_PROPERTY (report_id,REPORT_DESFORMAT);
    hidden_action := hidden_action ||'&userid='||get_application_property(username)||'/'||get_application_property(password)||'@'||get_application_property(connect_string);
    c_old :='@';
    FOR i IN 1..LENGTH(report_otherparam) LOOP
    c_new:= substr(report_otherparam,i,1);
    IF (c_new =' ') THEN
    c:='&';
    ELSE
    c:= c_new;
    END IF;
    -- eliminate multiple blanks
    IF (c_old =' ' and c_new = ' ') THEN
    null;
    ELSE
    v_report_other := v_report_other||c;
    END IF;
    c_old := c_new;
    END LOOP;
    hidden_action := hidden_action ||'&'|| v_report_other;
    hidden_action := reports_servlet||'?_hidden_server='||report_server_name|| encode(hidden_action);
    SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'pfaction='||hidden_action||' '||report_otherparam);
    -- run Reports
    report_message := run_report_object(report_id);
    rep_status := report_object_status(report_message);
    IF rep_status='FINISHED' THEN
    vjob_id :=substr(report_message,length(report_server_name)+2,length(report_message));
    message('job id is'||vjob_id);pause;
    WEB.SHOW_DOCUMENT(reports_servlet||'/getjobid'||vjob_id||'?server='||report_server_name,' _blank');
    ELSE
    --handle errors
    null;
    END IF;
    In the code - " hidden_action := hidden_action ||'&'|| v_report_other; " in the RUN_REPORT_OBJECT_PROC procedure above, how do i make sure that the v_report_other variable reflects the user input parameters FROM_DATE and TO_DATE ??? v_report_other is initialised as v_report_other VARCHAR2(4000) :=''; in the procedure. Will ensuring that the v_report_other contains the user input parameters FROM_DATE and TO_DATE ensure that my report will run fine for the input parameters?
    Thanks in advance.
    Edited by: user10713842 on Apr 7, 2009 6:05 AM

  • Date difference calculation with user input variable

    Hi,
    I have the following requirement in BEx:
    The user inputs a date value and I have to calculate the difference between the date entered by the user with the Due Date in the cube, to determine the number of backlog days. Basically, I need to calculate Past Due in number of days.  I need to display the Amount due for the Time buckets like 1 -10 days, 11 -30 days.
    The report output has to be in the format below:
    Columns:
    1 u2013 10 days Past Due      $100.00
    11 u2013 30 days Past Due    $15.00
    Rows:
    Customer#    
    The cube has data from Jan 2005 to June 2008.
    For Eg:   User Input Date =   04/30/2008.
    It should compare the input date to the due date for each record in the cube.
    Any suggestions are appreciated.

    Hi Kumar,
    We have developed simar reports in our previous projects.
    You need to follow the following steps.
    1. Create a new restricted key figure globally on Past Due $100. Restriction details I will let you know in the ensuing steps.
    2. Create another restricted key figure globally on Past Due $15. Restriction details I will let you know in the ensuing steps.
    3. Create a Z varuable on Calday and offset it -1 (use the button next to exclude button).
    4.Create another Z varuable on Calday and offset it -10 (use the button next to exclude button).
    5. Create another Z varuable on Calday and offset it -11 (use the button next to exclude button).
    6. Create another Z varuable on Calday and offset it -30(use the button next to exclude button).
    7 Restrict the RKF past due 100$ (defined in sl 1)between the variable range defined in 3 and 4.
    8. Restrict the RKF past due 15$ (defined in sl 2) between the variable range defined in 5 and 6
    Now drag and drop those two RKF to column and you will get the desired result in C1 and C2 as follows:
    Columns:
    C1 :1 u2013 10 days Past Due $100.00
    C2 :11 u2013 30 days Past Due $15.00
    If the above info serves your purpose, please reward me with the point.
    Regards,
    Subha

  • Powershell : Issues with user input collection from Multiple InPutBox Form

    I am having issues with getting user input to pass from a form that a user fills out into variables that I can then use in other methods and commands. (ex; SQL Query, SQL Data Add, ... )
    I have attached the Powershell script I am using in it's designed form but I am having issues getting the DataCollection function to grab the content of the InputBox and send it to a variable for later use.
    Note: I'm running this at this time from the ISE so I can actually see what is going on.
    Any help would be appreciated.
    DAS
    [System.Reflection.Assembly]::LoadWithPartialName( “System.Windows.Forms”)
    [System.Reflection.Assembly]::LoadWithPartialName( “Microsoft.VisualBasic”)
    $FormDBA = New-Object System.Windows.Forms.Form
    $FormDBA.Size = New-Object System.Drawing.Size(300,500)
    $FormDBA.Text = "MIS Data"
    $FormDBA.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen;
    function DataCapture
    $SubSID = $InBoxSID.text
    ECHO $SubSID
    $InBoxTxtSID = New-Object System.Windows.Forms.Label
    $InBoxTxtSID.Location = New-Object System.Drawing.Size(25,15)
    $InBoxTxtSID.Text = "Sticker ID : "
    $InBoxSID = New-Object System.Windows.Forms.TextBox
    $InBoxSID.Location = New-Object System.Drawing.Size(130,10)
    $InBoxSID.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtUSR = New-Object System.Windows.Forms.Label
    $InBoxTxtUSR.Location = New-Object System.Drawing.Size(25,55)
    $InBoxTxtUSR.Text = "User Name ; "
    $InBoxUSR = New-Object System.Windows.Forms.TextBox
    $InBoxUSR.Location = New-Object System.Drawing.Size(130,50)
    $InBoxUSR.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtPCN = New-Object System.Windows.Forms.Label
    $InBoxTxtPCN.Location = New-Object System.Drawing.Size(25,95)
    $InBoxTxtPCN.Text = "PC Name : "
    $InBoxPCN = New-Object System.Windows.Forms.TextBox
    $InBoxPCN.Location = New-Object System.Drawing.Size(130,90)
    $InBoxPCN.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtDPT = New-Object System.Windows.Forms.Label
    $InBoxTxtDPT.Location = New-Object System.Drawing.Size(25,135)
    $InBoxTxtDPT.Text = "Department : "
    $InBoxDPT = New-Object System.Windows.Forms.TextBox
    $InBoxDPT.Location = New-Object System.Drawing.Size(130,130)
    $InBoxDPT.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtPCT = New-Object System.Windows.Forms.Label
    $InBoxTxtPCT.Location = New-Object System.Drawing.Size(25,175)
    $InBoxTxtPCT.Text = "PC Type : "
    $InBoxPCT = New-Object System.Windows.Forms.TextBox
    $InBoxPCT.Location = New-Object System.Drawing.Size(130,170)
    $InBoxPCT.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtMAK = New-Object System.Windows.Forms.Label
    $InBoxTxtMAK.Location = New-Object System.Drawing.Size(25,215)
    $InBoxTxtMAK.Text = "Make : "
    $InBoxMAK = New-Object System.Windows.Forms.TextBox
    $InBoxMAK.Location = New-Object System.Drawing.Size(130,210)
    $InBoxMAK.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtMOD = New-Object System.Windows.Forms.Label
    $InBoxTxtMOD.Location = New-Object System.Drawing.Size(25,255)
    $InBoxTxtMOD.Text = "Model : "
    $InBoxMOD = New-Object System.Windows.Forms.TextBox
    $InBoxMOD.Location = New-Object System.Drawing.Size(130,250)
    $InBoxMOD.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtOPS = New-Object System.Windows.Forms.Label
    $InBoxTxtOPS.Location = New-Object System.Drawing.Size(25,295)
    $InBoxTxtOPS.Text = "O.S. : "
    $InBoxOPS = New-Object System.Windows.Forms.TextBox
    $InBoxOPS.Location = New-Object System.Drawing.Size(130,290)
    $InBoxOPS.Size = New-Object System.Drawing.Size(120,20)
    $InBoxTxtDIS = New-Object System.Windows.Forms.Label
    $InBoxTxtDIS.Location = New-Object System.Drawing.Size(25,335)
    $InBoxTxtDIS.Text = "Disposed : "
    $InBoxDIS = New-Object System.Windows.Forms.TextBox
    $InBoxDIS.Location = New-Object System.Drawing.Size(130,330)
    $InBoxDIS.Size = New-Object System.Drawing.Size(120,20)
    $button = New-Object System.Windows.Forms.Button
    $button.Location = New-Object System.Drawing.Size(150,400)
    $button.Width = 100
    $button.Text = “Ok”
    $button.Add_Click({DataCapture})
    $FormDBA.Controls.Add($button)
    $FormDBA.Controls.Add($InBoxTxtSID)
    $FormDBA.Controls.Add($InBoxTxtUSR)
    $FormDBA.Controls.Add($InBoxTxtPCN)
    $FormDBA.Controls.Add($InBoxTxtDPT)
    $FormDBA.Controls.Add($InBoxTxtPCT)
    $FormDBA.Controls.Add($InBoxTxtMAK)
    $FormDBA.Controls.Add($InBoxTxtMOD)
    $FormDBA.Controls.Add($InBoxTxtOPS)
    $FormDBA.Controls.Add($InBoxTxtDIS)
    $FormDBA.Controls.Add($InBoxSID)
    $FormDBA.Controls.Add($InBoxUSR)
    $FormDBA.Controls.Add($InBoxPCN)
    $FormDBA.Controls.Add($InBoxDPT)
    $FormDBA.Controls.Add($InBoxPCT)
    $FormDBA.Controls.Add($InBoxMAK)
    $FormDBA.Controls.Add($InBoxMOD)
    $FormDBA.Controls.Add($InBoxOPS)
    $FormDBA.Controls.Add($InBoxDIS)
    $FormDBA.ShowDialog()

    Change this:
    $button = New-Object System.Windows.Forms.Button
    $button.Location = New-Object System.Drawing.Size(150,400)
    $button.Width = 100
    $button.Text = “Ok”
    $button.DialogResult='Ok'  #<<<<<-------
    #$button.Add_Click({DataCapture})
    Remove function andrun like this:
    if('Ok' -eq $FormDBA.ShowDialog()){
        $FormDBA.Controls|%{$_.Text}
    With names you can get values by control name.
    ¯\_(ツ)_/¯
    This suggestion works for the purpose I needed. 
    If I could, I would attach the file instead of pasting the script so you can see what all I am using this to do.
    But in short, we have a main form we use to pull records from a database and call up an application at the click of a button for remote assistance.  However, we seem to now need the ability to have this application to edit and add new records into said
    database.  That's where this second form came in and also when I hit my issue with the information capture.
    At this time I'm getting this to format the information collected so that I can start using using it with SQL commands.

  • Macbook Pro hardshell with port / input output port protection?

    Dear All,
    This is my first post. Just a recently bought the 2012 Unibody (non-retina) 15" MBP Pro antiglare to replace my aging 2008 black MB.
    Throughout all my months (and perhaps years) of looking at cases, shell cases etc - I find it quite surprising that there's no hardshells out there that also protects the Input / Output / ports on the side as well as the DVD drive entry?
    My 2008 MB has accumulated so much dirt in the input output connectors over the years of use even with reasonable/adequate care, surely there is at least a port protection kit there somewhere on the net that someone has seen before?
    Any help would be greatly appreciated.

    19 views so far and no replies. Maybe no one cared about cleaning and protecting their connector ports after all?

  • Custom Exit - Get System Date with user input

    I am using a BW query to connect to a BOBJ universe.  Some reports from the universe must be scheduled to run for today's date and emailed to a user.  Unfortunately, we cannot determine "today" dynamically when scheduling in BOBJ.  There will be other reports filtered with a range.
    I want to create a BW custom exit variable to allow user input.  My idea is to take the user input, like "01/01/1904", and replace the value with today's date.
    Is this possible?
    Here's example code for what I am trying to achieve.
    IF user input = "01/01/1904" then get today's date.
    else use the values from the user input.
    Scenario 1: user inputs 08/01/2010 - 08/31/2010 the custom exit returns values 08/01/2010 - 08/31/2010
    Scenario 2: user inputs 01/01/1904 the custom exit returns 09/03/2010 (today)

    Hi,
    In your case, i_vnam variable and processing variable for below statement would be same.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'variable name'.
    Please see the below article for reference.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90?quicklink=index&overridelayout=true

  • App-V 5.0 SP2 RDS Client with hotfix 2 breaks frequently on Windows 2012R2 with User Profile Disks enabled

    Hi All,
    I am at my wit's end trying to troubleshoot this, so any help would be greatly appreciated.
    We are having serious stability issues with App-V 5.0 SP2 RDS in our environment with User Profile Disks enabled.
    We have applied the latest hotfix but the issues persist.
    The main problems are:
    1. Periodically the client seems to become corrupted and all applications stop working for all users. All applications including the official Microsoft Office 2013 ones - not just our packages.
    The symptoms are the same as if I change the App-V Client Service account to run under a user account instead of SYSTEM, so it suggests a file access issue. The log files also hint at this, and one of there errors is similar to this:
    The virtual application 'C:\Users\rds.user9\AppData\Local\Microsoft\AppV\Client\Integration\A3EF9C01-C0E9-4AC5-B21F-DB9B1D2F700C\Root\Mindjet\MindManager 14\MindManager.exe' could not be started because the
    App-V Subsystem 'Virtual Filesystem' could not be initialized. {error: 0x6740090A-0x20003}
    Once this problem occurs the only way I have found to fix it is to either completely remove and reinstall the client, or (perhaps this is the big clue) rename the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\MAV\Configuration\Volumes , unpublish
    an application, then republish said application.
    I don't even think it matters which application gets published. The point seems to be that this 'Volumes' key gets rewritten.
    I am highly suspicious that our issues are caused by User Profile disks in our RDS environment, as when I disable them on our staging collection all of these issues seem to disappear.
    I have made sure all of the servers have permissions on the share (folder and share permissions). It doesn't seem to make a difference.
    2.  Some application fail completely with User Profile Disks enabled. If we switch the setting from "Store all settings and data on the user profile disk" to "Store Only the following folders" there seems to be some improvement,
    in that at least one application that fails on the other setting starts to work.
    3. We have already set that NTFS 8 dot 3 reg fix some time ago.
    SOS!
    We have gone live this week (not my call) and this is having disasterous consequences. :(
    Thanks in advance,
    John

    Hi,
    Thanks for your response.
    I did try this a while ago without success, although it may be worth revisiting with SP2 applied.
    I have left this client now.
    I left them a Powershell script that deletes HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\MAV\Configuration\Volumes
    and triggers an Unpublish/Publish of an application we have deployed to all of the servers.
    This seems to work, but a fix would be better than a workaround.
    Not really my problem now though - I did my best.
    Thanks,
    John

  • Need help creating script to clear data with user inputs

    Hi experts.
    I need to create a script to clear data in a DEV system from a particular junction.
    Basically, I need the user to enter a CATEGORY, ENTITY and TIME which will then be used to delete all data in a particular table which meetes those criteria.
    I tried to write it in SSIS, but can't get a user input box.
    Also, Stored Procedures are not designed to open input boxes for these entries.
    Therefore, is there a way to do this in BPC script logic?
    I believe that I might be able to write either a Stored Procedure or DTSX package and then pass data from BPC Run Package?
    If this is correct, how would I go about it?
    Also, would it be possible to read the DISTINCT entries for Category, Time and Entity and present as a dropdown list?  (It doesn't matter too much if not, a manual entry would have to do).
    I will admit that I have no experience of script logc, so any docments and/or pointers would be appreciated.
    Thanks

    Thank Karthik, but I can't use the clear for this job.
    Specifically, I need this to delete from the LCK tables whenever data gets stuck, so if anyone can tell me the format to use, I'd be extremely grateful
    (And I appreciate that this is not recommended, but it's a DEV system and we need a way to clear these locks quickly when they occur)
    Edited by: Pie Eyed on Oct 1, 2011 2:54 PM

  • Problem with sound input/output settings

    Hello--
    Last night, my iBook suddenly stopped playing any sounds at all: itunes, CDs, etc, won't play at all. I looked in system preferences/sound, and the computer told me that there are no input or output devices at all. What's more, the sound seems to me on permanent mute, and it won't allow me to change it at all (F4 and F5 functions just show a "mute" sign under the volume bar). Is this a problem with the software, hardware, or what? Thanks in advance for any advice,
    JB Coleman

    here is a set of weird but probable solutions. Good luck
    Solutions

  • Creating a batch file to launch a program with user input variable.

    I am trying to create a batch file that allows a user to be prompted to put in a value and then launches the program associated and that particular file. In this case the files are CIF files that pull up saved data inputs. Below is my script so far and what I am trying to accomplish is the user presses 1 and hits enter and is prompted to enter the CIF file name, then the application launches and the paramaters open the selected CIF file.ECHO OFF
    CLS
    :MENU
    ECHO.
    ECHO ...............................................
    ECHO PRESS 1, 2, for your task or 3 to EXIT
    ECHO ...............................................
    ECHO.
    ECHO 1 - Open Cape Pack CIF FIle
    ECHO 2 - Open Calculator
    ECHO 3 - EXIT
    ECHO.
    SET /P M=Type 1, 2, or 3 then press ENTER:
    IF %M%==1 GOTO Cape Pack
    IF %M%==2 GOTO CALC
    IF %M%==3 GOTO EOF
    :Cape Pack
    cd %windir%\Program Files (x86)\cape211\...
    This topic first appeared in the Spiceworks Community

    I am trying to create a batch file that allows a user to be prompted to put in a value and then launches the program associated and that particular file. In this case the files are CIF files that pull up saved data inputs. Below is my script so far and what I am trying to accomplish is the user presses 1 and hits enter and is prompted to enter the CIF file name, then the application launches and the paramaters open the selected CIF file.ECHO OFF
    CLS
    :MENU
    ECHO.
    ECHO ...............................................
    ECHO PRESS 1, 2, for your task or 3 to EXIT
    ECHO ...............................................
    ECHO.
    ECHO 1 - Open Cape Pack CIF FIle
    ECHO 2 - Open Calculator
    ECHO 3 - EXIT
    ECHO.
    SET /P M=Type 1, 2, or 3 then press ENTER:
    IF %M%==1 GOTO Cape Pack
    IF %M%==2 GOTO CALC
    IF %M%==3 GOTO EOF
    :Cape Pack
    cd %windir%\Program Files (x86)\cape211\...
    This topic first appeared in the Spiceworks Community

  • High user input output (I/O) and physical reads

    Hi guys
    Recently we have noticed that our database performance degraded significantly. as we looked around in grid control we noticed that the user IO and Physical reads are really high which cause the database to be laggy.
    at first we thought it was memory problem, so we added 2gb to sga. we have set sga to be automatic and it's been like this for the past 2 years.
    how do i trouble shoot this problem. i haven't found any troubleshooting guide for it yet.
    please instruct me on how to solve it
    database: 10.2.0.4 sparc
    regards
    Sina

    Top 5 Timed events
    db file sequential read          23,582          679          29          46.3     User I/O
    CPU time                                        626                    42.7     
    db file scattered read     3,089     70     23     4.8     User I/O
    db file parallel write     3,478     28     8     1.9     System I/O
    log file parallel write     4,201     24     6     1.7     System I/O
    SGA Memory Summary
    SGA regions     Begin Size (Bytes)     End Size (Bytes) (if different)
    Database Buffers     2,768,240,640     2,835,349,504
    Fixed Size     2,050,240     
    Redo Buffers     14,721,024     
    Variable Size     3,657,439,040     3,590,330,176
    Process Memory Summary
         Category     Alloc (MB)     Used (MB)     Avg Alloc (MB)     Std Dev Alloc (MB)     Max Alloc (MB)     Hist Max Alloc (MB)     Num Proc     Num Alloc
    B     Other     569.22     0     2.62     3.14     22     24     217     217
         Freeable     101.63     0.00     0.77     0.45     3          132     132
         SQL     91.51     45.35     0.44     0.76     4     78     209     192
         PL/SQL     12.50     5.57     0.06     0.07     0     4     217     217
         JAVA     5.40     5.38     1.08     0.09     1     2     5     5
    E     Other     603.20          3.03     3.62     22     24     199     199
         SQL     115.21     64.78     0.60     1.67     21     78     191     182
         Freeable     112.31     0.00     0.83     0.43     3          135     135
         PL/SQL     13.89     5.94     0.07     0.12     1     4     199     199
         JAVA     8.93     8.89     1.12     0.23     2     2     
    for some reason i can't paste a table into this post but if you want i can email you above tables

Maybe you are looking for