5 posts in this topic
@Username issue and temp access
I'm writing a tool that will help my technician adding a user in the local admin group.
1- As the user, at first, is not part of the group, launching the .exe file ask for admin credentials. Thing is, whereas I'm using
RunWait(@ComSpec & ' /c ' & 'Net LocalGroup Administrators' & @username & ' /add' ,"") The @username macro is taking the admin user account in the variable instead of the current logged user one.
Do you know how can I face this and have the "real" username value returned?
2- do you guys think it's possible to give the admin access temporary? Maybe something to write in the reg? task scheduler? compare dates and execute a .exe? etc...?
Thanks in advance
Mailing from Excel/variable storing
Purpose of script: To send emails in Outlook based on data in an excel spreadsheet. From: fields are entered for purposes of sending on behalf of (delegate), copies A2 cell from excel for To: field, Subject field is a static value and entered, returns to excel spreadsheet to read A1 and copy the first name and insert into the body of a template at an insertion point. The From, and the body of the email change based on region, so currently I have 6 different scripts that do essentially the same thing with some minor changes and want to consolidate into one script to save time.
To expedite the process of this and cut down on the amount of scripts, 6 in total I use daily, is it possible for me to somehow add the region to column C in excel, have autoit read column C values per row, and then decide which function, within a master script, to execute and loop this until there is no value in column C field?
Rob | firstname.lastname@example.org |Midwest
Annie | email@example.com | Midwest
Kyle | firstname.lastname@example.org | MidAtlantic
Rick | email@example.com | MidAtlantic
Blank | Blank | Blank |
Run Birthday.au3, execute loop part through hotkey
Reads row 1, C1, value is Midwest, calls Midwest(), script runs as Midwest Birthday.au3 does currently
Reads row 2, C2, value is Midwest, calls Midwest(), script runs as Midwest Birthday.au3 does currently
Reads row 3, C3, value is MidAtlantic, calls MidAtlantic(), script runs as MidAtlantic Birthday.au3 currently
Reads row 4, C4, value is MidAtlantic, calls MidAtlantic(), script runs as MidAtlantic Birthday.au3 currently
Reads row 5, C5, value is null or blank, ends script through Exit
Everything I have coded in my time in AutoIt has been based mostly on mouse based movements and I don't have variable programming knowledge so I feel like I'm close to understanding how to do this, but the reading/storing variables part is beyond my current skill set. Help is appreciated.
Mail Merges don't work as delegated in Outlook 07, for those that might be questioning why I just don't do that.
AutoItSetOption for arrays
If we give the below line in our script, we can expand the variables in double quotes to its values.
AutoItSetOption ("ExpandVarStrings", 1) Like,
Local $b=4 MsgBox(0,"$b$","See subject") But coming to variables, they are not getting expanded.
Local $a=[1,2,3] Local $b=4 _ArrayDisplay($a) MsgBox(0,"$a$$b$","See subject") Could anyone please help me on this.
Run variable as script
Is there a way to execute the text inside a variable is if it was part of the script?
In this example I'd like to get a message box pop up but I don't:
;testme.au3 local $var = 'msgbox(64,"hello","world")' $var is there a command that can be used like maybe 'Exec' or 'Execute' or something?
local $var = 'msgbox(64,"hello","world")' Execute $var
Subscript Used on Non-Accessible Variable WinGetPos error
Func workSpaceSetup () ConsoleWrite ("workSpaceSetup" &@CRLF) $workSpace = WinGetHandle ("some site - Google Chrome") ConsoleWrite ($workSpace&@CRLF) $pos1 = WinGetPos ($workSpace) WinMove ($workSpace , "", $pos1 , $pos1 , 1366, 768, 0) EndFunc So the script is first, the error I get is second in the quote.
This is one function of many for an app I am building but it is the first one that runs so I know there aren't other things at play here.
The idea is to keep the window in the same space it is when the script runs but just resize it as this app is used across multiple computers with different screen resolutions.
Could someone please elaborate upon what "Subscript used on non-accessible variable" means?
Oh and the variable is declared as "Global $pos1 = 0" at the top outside of any functions with the other global variables.
Any advice would be greatly appreciated!