0

I have a global .py file which need to be run from my project directory.

python C:\path\to\global_python.py param1

Because of the path to .py file is quite long, so I'm trying to set alias using doskey.

I have successfully setup aliases as below examples

subl="C:\Program Files\Sublime Text 3\sublime_text.exe" $*
python="C:\Python27\python.exe" $*
pip="C:\Python27\Scripts\pip.exe" $*

So I have tried to setup an alias for my global .py file.

bower_setup="C:\Users\Admin\Documents\home_www\bower\bower_setup.py"

I tried to execute it, using python bower_setup param1 but it was not working.

enter image description here

Please help me fix this problem, if possible I prefer not to set the windows system path variable.

Thanks.

Artisan
  • 4,042
  • 13
  • 37
  • 61

1 Answers1

0

I think, you have to alias as follows:

set subl="C:\Program Files\Sublime Text 3\sublime_text.exe"

When you are using, you should use as

 %subl%

for example,

 echo %subl%

echoes "C:\Program Files\Sublime Text 3\sublime_text.exe"

venpa
  • 4,268
  • 21
  • 23
  • It's not about Sublime, I'm asking about **executing** .py file from other path which is not current working directory. – Artisan Mar 18 '14 at 20:13
  • i have taken sublime as example, sameway you have to set for other 2 variables and access with %% while using. – venpa Mar 18 '14 at 21:15
  • I have tried `set bower_setup="C:\Users\Admin\Documents\home_www\bower\bower_setup.py"` as you suggested, it was not working, quite surprise `echo %bower_setup%` returns **%bower_setup%** instead of **bower_setup** – Artisan Mar 18 '14 at 21:28
  • it works in my machine..can you try "set "bower_setup=C:\Users\Admin\Documents\home_www\bower\bower_setup.py"" and access using %bower_setup% – venpa Mar 18 '14 at 21:32