Script OnStartup objCmd.RunCommand("Set ADMIN=on,100") code is not executed?

option explicit

' Set Admin
' 
' 
' This is a script for Directory Opus.
' See http://www.gpsoft.com.au/DScripts/redirect.asp?page=scripts for development information.
' 
' 
' 
' Called by Directory Opus to initialize the script
Function OnInit(initData)
	initData.name = "Set Admin"
	initData.desc = ""
	initData.copyright = ""
	initData.version = "1.0"
	initData.default_enable = false
End Function

' Called when Directory Opus starts up
Function OnStartup(startupData)
    Dim objCmd
    Set objCmd = DOpus.NewCommand
    objCmd.RunCommand("Set ADMIN=on,100")
    Set objCmd = Nothing
End Function

Directory Opus Title bar does not show "administrator".

Set ADMIN requires a Lister, at the time OnStartup() is executed there are no Listers open.

thanks jon

dopusrt.exe /acmd

Can only execute go command?

It can run any command.

But the "a" in /acmd does not stand for "admin" if that's what you're expecting.

While /cmd chooses the Source lister, /acmd chooses the (most recently) active lister, when running commands which need a lister.

What are you aiming to do?

[quote="leo"]It can run any command.

But the "a" in /acmd does not stand for "admin" if that's what you're expecting.

While /cmd chooses the Source lister, /acmd chooses the (most recently) active lister, when running commands which need a lister.

What are you aiming to do?[/quote]

I want to execute this command "Set ADMIN=on,100"

What do you expect executing that command to do?

"Set ADMIN=on" will elevate a single lister window. It does not make sense to try to run that command when no listers exist.

So either you are trying to use the wrong command to do whatever you're trying to do, or you have found the right command but are trying to use it in a way which does not make sense.

We need to know what you're actually trying to do with the command to be able to help.