Page 1 of 1

Run command - directory level up

PostPosted: Mon Oct 24, 2011 12:35 pm
by wzp
Hi.

How can I run external program that is one level up from my pub dir. Example:

C:\new folder\mypub.exe
C:\file.exe

Now i want to run that file.exe from folder where mypub.exe is. I use push button with this action command:

Run "file.exe" "" "Normal"

But it doesnt work because there must be some command or SetVar for level up, for example:

Run "..\file.exe" "" "Normal"

or

SetVar "[test]" "..\"
Run "[test]file.exe" "" "Normal"

I wrote command "..\" for level up but it doesnt work, so I need help and information for correct directory level up command.

Thanks

PostPosted: Mon Oct 24, 2011 1:08 pm
by dec
Hi,

A possible approach is to use the "CurrentDir" variable. You can found more on this in the NeoBook help. You can write something like this:

Code: Select all
.Set the current dir pointing to the publication dir

SetVar "[CurrentDir]" "[PubDir]"

.Up a directory from the publication directory

SetVar "[CurrentDir]" "..\"

.Run a.exe wich is placed on the current directory

Run "[CurrentDir]a.exe" "" "Normal" "" ""

PostPosted: Mon Oct 24, 2011 1:32 pm
by wzp
Thanks dec! Works perfectly!

PostPosted: Mon Oct 24, 2011 1:39 pm
by dec
You're welcome!

wzp wrote:Thanks dec! Works perfectly!

PostPosted: Mon Oct 24, 2011 3:07 pm
by dec
Hi,

I can't resists to add a new action on npUtil plugin: npParentDir.

Thanks for the idea!