16 posts
Posted 08 September 2012 - 10:13 PM
hi,
i want to know if there is a way that i can make a program that you can run when your in any directory, like the built in programs.
1604 posts
Posted 08 September 2012 - 10:17 PM
You have to add the path to the program (the directory containing it) to the programs path, using shell.setPath.
16 posts
Posted 08 September 2012 - 10:26 PM
You have to add the path to the program (the directory containing it) to the programs path, using shell.setPath.
When i do that it stops all the normal programs from running like dir or list
1604 posts
Posted 08 September 2012 - 11:41 PM
That's because you are replacing the path. Try adding it like this:
shell.setPath(shell.getPath()..":/The/Path/To/Your/Programs")
871 posts
Posted 08 September 2012 - 11:42 PM
shell.setPath(shell.getPath()..":"..newPath)
there's a similar function in the help api to add to the help path. Path is checked in order, if you want yours to run first, like you made a better edit command, reverse the order and do newPath..":"..shell.getPath()
:edit: damn ninjas. :D/>/>