Passing value from vbscript to dopus using ENV vars

I'm trying to replicate an example written by leo on this post:

basically i want to set a env variable with vb script and then use it in the dopus GO command.
the code is listed below.


@script vbscript
Option Explicit

Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)

Dim Shell
Set Shell = CreateObject("WScript.Shell")

Dim EnvVars
Set EnvVars = Shell.Environment("PROCESS")

EnvVars("RENAME_TARGET") = "d:"
MsgBox("done - variable set from vb")

End Function[/code]

In the above mentioned post leo said about using @noexpandenv at the top so the env vars are not set before the vb script runs.
the trouble is that the variable (RENAME_TARGET) is not set at all when the GO command runs.
instead of having "GO d:" it tries to literally go to "%RENAME_TARGET%"

if I remove the @noexpandenv the variable works (meaning the variable is initialized with the env var value) but indeed the variable is set before the script runs and it doesn't help very much.

In conclusion how do I run the vb script first and then be able to use the env var set by the vb script (since specifying @noexpandenv recommended in leo's article seems not to set the variable at all and use the string literally).

I'm running dopus (4969) x64 on windows 8
maybe someone can update my simple example to make it work if it's not too much trouble

thanks in advance

Even this doesn't work at the moment:

@noexpandenv Go "%windir%"

The Go command itself won't expand the variable so it'll only work if it's expanded by the button (which @noexpandenv prevents, of course).

I've made a change for the next update so that this will work again.

cool then
thanks for taking note

As workaround it seems to work when using dopusrt with the Go command:
dopusrt /cmd Go "%RENAME_TARGET%"

Yep, that workaround will solve things for now, as long as you don't need the command to wait for the folder to be read, as it'll probably end up being asynchronous when run via dopusrt.