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.


0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



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. 

Answered 09/06/2012 by: SMal.tmcc
Red Belt

  • if you have a kace1000 box create a script and it will run without needing the user to have any extra rights.
Please log in to comment
Answer this question or Comment on this question for clarity



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.

Answered 09/07/2012 by: dugullett
Red Belt

  • 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.
    • The software isn't too difficult. You add your script, and include any dependencies that are needed.
      • 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.
  • Did you check "Visible Application"? Does your batch file open and do what you need it to do?
  • I tried this script
    "C:\Program Files\Putty\pscp.exe"


    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.
Please log in to comment

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

Answered 09/11/2012 by: shamu99
Fifth Degree Brown Belt

Please log in to comment