Sign in to follow this  
Followers 0
Wagner

Startup Script problem

6 posts in this topic

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 :)

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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 :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0