Jump to content

ProcessClose() Woes


Recommended Posts

Hi all,

Hope ya have some advice :lmao:

The following code works as you would expect; DOS box opens, waits 2 secs, then closes.

$runPID=Run(@SystemDir & "\" & "cmd.exe",@SystemDir)
Sleep(2000)
ProcessClose($runPID)

However, if I open the DOS box as another user, I cannot close the box at all, as so:

RunAsSet("Administrator","domain-name","password")
$runPID=Run(@SystemDir & "\" & "cmd.exe",@SystemDir)
Sleep(2000)
ProcessClose($runPID)
RunAsSet()

Can anyone give any suggestions for process killing as another user?

Thanks!

Please correct me if I am wrong in any of my posts. I like learning from my mistakes too.

Link to comment
Share on other sites

Yep, I knew the user doesn't have the rights, hence getting the processclose to "runas".

This works a treat, I always forget about the AutoIt script lines.

Thanks!

Please correct me if I am wrong in any of my posts. I like learning from my mistakes too.

Link to comment
Share on other sites

Pfff.. have been trying for like an hour now...

but create a shortcut to tskill (located in system32) with the arguments cmd

then run your shortcut and delete it.

I couldn't get runwait(@comspec & " /c" & "tskill cmd", "", @SW_HIDE) to work...

Good luck.

EDIT - I completely forgot Processclose .... why do I always try things the hard way? DOE!

Edited by daslick
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...