Jump to content

Startup Script problem


Recommended Posts

I have a AutoIT script and when I put this in the LogonScript (Active Directory GPO) it work fine, but if I put the same script in the Startup Script section in the GPO it doesn't work. The error is "Unable to execute the external program. Access denied".

This is the Script:

RunAsSet("AdminUser","DOMAIN","password")

$Command = @ComSpec & ' /c Copy \\FileServer\SharedFolder\FileToCopy.tmp ' & @WindowsDir

RunWait($Command,@WindowsDir,@SW_HIDE)

RunAsSet()

I'm tried with another locations (C: Drive, etc.) and the error is the same.

Anyone can help me?

Regards

Wagner :)

Link to comment
Share on other sites

Try this, DOS commands work with just Run() or RunWait():

RunAsSet("AdminUser","DOMAIN","password")
$Command = 'Copy \\FileServer\SharedFolder\FileToCopy.tmp ' & @WindowsDir
RunWait($Command,@WindowsDir,@SW_HIDE)
RunAsSet()

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Link to comment
Share on other sites

I have a AutoIT script and when I put this in the LogonScript (Active Directory GPO) it work fine, but if I put the same script in the Startup Script section in the GPO it doesn't work. The error is "Unable to execute the external program. Access denied".

This is the Script:

RunAsSet("AdminUser","DOMAIN","password")

$Command = @ComSpec & ' /c Copy \\FileServer\SharedFolder\FileToCopy.tmp ' & @WindowsDir

RunWait($Command,@WindowsDir,@SW_HIDE)

RunAsSet()

I'm tried with another locations (C: Drive, etc.) and the error is the same.

Anyone can help me?

Regards

Wagner :)

don't you have another line in the error message box ?

I don't think the neogia answer can help.

Link to comment
Share on other sites

don't you have another line in the error message box ?

I don't think the neogia answer can help.

JPM, before the message appear the command, all in one window, but anything else.

Do you know something about this problem?

Thanks

Link to comment
Share on other sites

JPM, before the message appear the command, all in one window, but anything else.

Do you know something about this problem?

Thanks

For the records, this is because in the startup script the active directory don't need the autentication, and if someone use the autentication (with RunAsSet) an error will be generated.
Link to comment
Share on other sites

For the records, this is because in the startup script the active directory don't need the autentication, and if someone use the autentication (with RunAsSet) an error will be generated.

so you get an extra line in the messagebox about authenfication failure. Right?

Just make a copy of the message box and post it.

Thanks :)

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...