Jump to content

Using @LogonServer macro in a Run() statement


Recommended Posts

I want users to run a script, based on their authenticating domain controller. I have copies of a target script in NETLOGON and has replicated to all DCs. Here's the script

;Hide any fatal error messages

Opt("RunErrorsFatal", 0)

;Call this vbscript from netlogon on the authenticating DC

Run("@LogonServer\netlogon\localscript.vbs ScriptArgHere")

The error I get says "Unable to execute external program". I know I've seen this work in the past, but cannot get the syntax right. Any thoughts on how to make this work?

Link to comment
Share on other sites

It gives me the same error, but when I print the string to the screen (see below), the string looks correct. It gives me "\\myauthdc\netlogon\localscript.vbs ScriptArgHere". If I throw that string in a Run box, it works like a champ. Not sure why it wont fly from my AutoIT script.

$localscript = '"' & @LogonServer & '\netlogon\localscript.vbs ScriptArgHere"'

$var = @LogonServer

MsgBox ( 4096, "Testing", $localscript)

Link to comment
Share on other sites

Hi,

try same command with _RunDos()

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

I forgot you're trying to run a vbs script.

you can try as th.meger suggested but don't forget to add the following line at the begging of your script

#include <Process.au3>

Or

try

Run(@ComSpec & ' /c "' & @LogonServer & '\netlogon\localscript.vbs ScriptArgHere"', @WorkingDir)

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...