Sign in to follow this  
Followers 0
ken82m

RunAs on Internal AutoIT Command

4 posts in this topic

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


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


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


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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.

Share this post


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


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "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."

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