Source language: Translate to:

Run command - directory level up

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Run command - directory level up

Postby wzp » Mon Oct 24, 2011 12:35 pm

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
wzp
 
Posts: 10
Joined: Fri Jan 07, 2011 9:46 pm

Postby dec » Mon Oct 24, 2011 1:08 pm

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" "" ""
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby wzp » Mon Oct 24, 2011 1:32 pm

Thanks dec! Works perfectly!
wzp
 
Posts: 10
Joined: Fri Jan 07, 2011 9:46 pm

Postby dec » Mon Oct 24, 2011 1:39 pm

You're welcome!

wzp wrote:Thanks dec! Works perfectly!
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby dec » Mon Oct 24, 2011 3:07 pm

Hi,

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

Thanks for the idea!
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 0 guests

cron