Jump to content
Sign in to follow this  
anandnz

Run with a cmd variable

Recommended Posts

anandnz

Hi Experts,

I hit the wall and this time trying to run notepad++.exe from a command prompt.

This is a sample excersice as actually wanted to run a big line of command for a third party. Any help is appreciated.

#include <File.au3>
$CR = 'notepad++.exe'
$command = " C:\Program Files\Notepad++\" & $CR
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $command = ' & $command & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console ;
Run($command); THIS DOES NOT SEEM TO WORK, HOWEVER WHEN I COPY THE OUTPUT IN "start" "run" it works not via Run command HELP HERE
Edited by anandnz

Share this post


Link to post
Share on other sites
somdcomputerguy

Remove the leading space in the $command variable,

so this:

$command = " C:\Program Files\Notepad++\" & $CR

becomes this:

$command = "C:\Program Files\Notepad++\" & $CR


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
anandnz

Hi somedcomputerguy,

Thank you very much. It works. cheers

Share this post


Link to post
Share on other sites
somdcomputerguy

You bet. Good luck!


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.