Jump to content

RunAs on Internal AutoIT Command


 Share

Recommended Posts

One of my end users will be running a script as them, I will be performing a runas on a few setup programs but first I want to remove a folder. They should have modify to it alreayd but it is always possible that somebody screwed up.

Is it possible to use the internal runas on the internal AutoIT Directory Removal command or will I have to use the old %comspec% thing?

Thanks,

Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

I'll try that now, i'm trying to understand the:

If $CmdLine[0] = 0

Can you give me some details on that?

Thanks,

Kenny

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

If $CmdLine[0] = 0 means there was no other files dragged and dropped on it, or typed into the command line. Or as Larry points out run twice, we have different ways of making sure things run once only. :whistle:

if your program was bob.exe

it would make sure it was run like run("bob.exe") not

run("bob.exe /fred") or

run("bob.exe c:\virus.exe")

$CmdLine[0] returns the total amount of extra comandline options. ex

copyme.exe c:\file.txt d:\file.txt

$CmdLine[0] would equal 2 in this case.

copyme.exe would be the the program, c:\file.txt would be the first one($CmdLine[1] ), d:\file.txt would be the second. ($CmdLine[2])

Documentation may provide a more clear answer for ya.

Amazing how many approaches to reach the same outcome. I open paint cans with kitchen knives as well. B)

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Worked great guys thanks, and thanks for the explanation I THINK I know what I'm doing now B)

This is the first AU3 I'm doing from sratch, so I'm doing my best :whistle:

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

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