Jump to content

Recommended Posts

Posted

Hi,

I have this script to runas an admin(domain account) because the normal user don't have permissions to do it.

-------------------------------------------------------------------------------------

#NoTrayIcon

$USERNAME = "admin"

$DOMAIN = "domus"

$PASSWORD = "password"

RunAsSet($USERNAME, $DOMAIN, $PASSWORD)

FileDelete("c:\test.txt")

RunWait("C:\WINDOWS\system32\cmd.exe", "C:\WINDOWS\system32")

RunAsSet()

Exit

--------------------------------------------------------------------------------------

The problem is the FileDelete command is not working under the runasset. The RunWait is running fine under this admin account.

The strange thing is that when i logged in as the admin account, the filedelete command run fine ofcours, but when i logged in as a user which have no permissions do delete this file, this does not delete this file.

Can somebody help me out?

thanks

Posted

Hi,

The RunAsSet only works for the Run/RunWait commands, not for the filedelete.

But u could try

RunAsSet(bla....)

RunWait('cmd /c del c:\test.txt /y')

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Posted

Hi,

The RunAsSet only works for the Run/RunWait commands, not for the filedelete.

But u could try

RunAsSet(bla....)

RunWait('cmd /c del c:\test.txt /y')

Andre

<{POST_SNAPBACK}>

Oh ok, i didn't knew that

thanks for the info

Posted

Hi,

could be found in the manual :(

Andre

ps. Good luck exploring AutoIt.

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!

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
×
×
  • Create New...