/build/static/layout/Breadcrumb_cap_w.png

Script to open command window and run an executable

Hi all,

I am trying to write a scipt where I can open a command window first and then it should go to the location where there is a direct exe, so it would launch .

This exe when opened in a comand window shows some options, it does not do the same when double clicked directly.

So I want a script where the User on clicking the batch file it will open the command window and then run this exe so it will show those options on the command window.

Any help is appreciated.

Thanks


0 Comments   [ + ] Show comments

Answers (3)

Posted by: SMal.tmcc 12 years ago
Red Belt
3

cmd.exe c:\directory\subdirectory\directx.exe /any switches

You can place this batch on a share and create a shortcut on the desktop that points to it and put the directx directory in the "start in" box of the shortcut.

should work for you.  this will run with the current users rights, you would need to run the batch as an admin if needed. 


Comments:
  • if you have a kace1000 box create a script and it will run without needing the user to have any extra rights. - SMal.tmcc 12 years ago
Posted by: dugullett 12 years ago
Red Belt
1

I wonder if using something like this http://www.f2ko.de/programs.php?lang=en&pid=b2e and making an exe out of your script would work? Then just deploy the exe.


Comments:
  • Thanks for the reply. If I have the script to open the command window and then run the exe. Then I think I can go ahead with the link you mentioned. where I would create the an exe from the batch script. How can I go about it. - shamu99 12 years ago
    • The software isn't too difficult. You add your script, and include any dependencies that are needed. - dugullett 12 years ago
      • Thanks, I am able to create the exe from the batch file. But my script seems to not work.
        I need a script, so I can open the command window first and then run the pscp.exe from the program files, because when opening the command window and then running the exe shows the options of that exe e.g /p , or /f... If I double click directly the exe, the command window does not open. - shamu99 12 years ago
  • Did you check "Visible Application"? Does your batch file open and do what you need it to do? - dugullett 12 years ago
  • I tried this script
    "C:\Program Files\Putty\pscp.exe"

    pause

    On executing this, the exe would run showing the options of the exe, and on pressing any key the window would disappear, But I want to progress on the same command window, I dont want it to close.
    But if I remove pause, the command window shows up for a second and disappears. - shamu99 12 years ago
Posted by: shamu99 12 years ago
Fifth Degree Brown Belt
0

Thanks for the replies.

SMAI.tmcc I tried your method, but when putting the directx directory in the "start in" box of the shortcut, I get the below error, and I do have those files and folder in the same location

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ