Sign in to follow this  
Followers 0
anandnz

Run with a cmd variable

4 posts in this topic

#1 ·  Posted (edited)

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



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

Hi somedcomputerguy,

Thank you very much. It works. cheers

Share this post


Link to post
Share on other sites

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  
Followers 0