 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
SecurityAnalysis Guest
|
Posted: Fri Mar 14, 2008 7:47 pm Post subject: if not A_IsAdmin... restart script without manual entering? |
|
|
I use this code snippet on a Windows 2000 system. Is it possible to change the code a bit so that I don't have to enter the password manually? Or is there any other way for a script to give itself admin rights without manual input?
| Code: |
if not A_IsAdmin
{
DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
, str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
ExitApp
}
|
|
|
| Back to top |
|
 |
SecurityAnalysis Guest
|
Posted: Wed Mar 19, 2008 10:48 pm Post subject: |
|
|
| Is it possible to change the code a bit so that I don't have to enter the password manually upon Runas restart? |
|
| Back to top |
|
 |
SecurityAnalysis Guest
|
Posted: Fri May 16, 2008 6:54 pm Post subject: |
|
|
| Bump |
|
| Back to top |
|
 |
Conquer
Joined: 27 Jun 2006 Posts: 385 Location: Canada
|
Posted: Fri May 16, 2008 10:18 pm Post subject: |
|
|
Sounds... Sly
Um, use the command RunAs ?
lolz |
|
| Back to top |
|
 |
Troll Guest
|
Posted: Fri May 16, 2008 11:18 pm Post subject: |
|
|
| Sry you fail at internetz lol |
|
| Back to top |
|
 |
bkpsusmitaa
Joined: 09 Jan 2009 Posts: 6
|
Posted: Fri Jan 09, 2009 8:05 am Post subject: whether A_IsAdmin can be tweaked a bit to automate process |
|
|
The popular code A_IsAdmin:
| Quote: | if not A_IsAdmin
{
DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
, str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
ExitApp
} |
is oft-quoted to be placed at the top of a script, but no reply has been found to contain a solution as to whether in WindowsXP an owner of the computer, who is an administrator, but chooses to carry on his day-to-day activity as a guest, can automate the script so that the window for username and password does not appear any longer, but the script is run.
In nutshell, can someone please elaborate wordwise / phrasewise analysis of the above quoted script?
For example,
(1) DllCall : we know
(2) shell32\ShellExecuteA : calls the shell32 file to execute some work
(3) uint : something we do not know
(4) 0 : why is 0 written
(5) str: the need for str
...
so on and so forth
Knowledgeable people please help spread knowledge and prevent knowledge becoming extinct.
Regards _________________ I am Rajib Kumar Bandopadhyay, living in India, in service, love computing |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|