
Legacy99
Active Members-
Posts
98 -
Joined
-
Last visited
Profile Information
-
Location
Canada - NB
Legacy99's Achievements

Wayfarer (2/7)
0
Reputation
-
Copying files/directories in win7 with progress bar
Legacy99 replied to teknosjef's topic in AutoIt General Help and Support
Yep, try this, just tested on Win7 X64 _FileCopy($fromFile, $tofile) Local $FOF_RESPOND_YES = 16 Local $FOF_SIMPLEPROGRESS = 256 $winShell = ObjCreate("shell.application") $winShell.namespace($tofile).CopyHere($fromFile, $FOF_RESPOND_YES) -
X86 and X64 If Then Statement Adobe install
Legacy99 replied to vnavna's topic in AutoIt General Help and Support
What you need to do is: when the If condition for the 32bit and if it's false, the Else part will be the default (for 64bit in your case) Think of an "IF/Else" like this: "IF" this part is true then end, ELSE this part is true because the "IF" part was false. IF x86 Then Do the check and uninstall of the versions for 32 bit OS Else ; this part will be the default because x86 part is false Do the check and uninstall of the 64 bit OS Endif For example If @CPUArch = "X86" Then If FileExists(@ProgramFilesDir & "\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf ;Put the installer for 32 bit Adobe 10 here Else ;x64 part starts now since X86 was false otherwise it is skipped since the first section ran (it was a 32bit OS). If FileExists(@ProgramFilesDir & "\Adobe\Reader 10.0\Setup Files\{AC76BA86-7AD7-1033-7B44-AA0000000001}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81100000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81200000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81200000003} /qn","",@SW_HIDE) EndIf If FileExists (@ProgramFilesDir & "\Adobe\Reader 8.0\Setup Files\{AC76BA86-7AD7-1033-7B44-A81300000003}") Then RunWait(@ComSpec & " /c " & "msiexec /x {AC76BA86-7AD7-1033-7B44-A81300000003} /qn","",@SW_HIDE) EndIf ;Put the installer for 64 bit Adobe 10 here EndIf ;Put an installer that is OS independant here and remove the ones that are in the IF statment.. Oh, and use @ProgramFilesDir, that way it's more like a wildcard and you don't have to worry about the exact path, the Macro will take care of it. -
That's exactly what should happen, This code $dir= "d:\temp\hmmm [2010] wtf- is this" $num="3" FileMove($dir & "\" & "*.tmp", $dir & "\" & $num & "*.tmp", 0) Equals on the destination "d:\temp\hmmm [2010] wtf- is this\3*.tmp" You are concatenating the $NUM variable with your $DIR variable. What are you trying to do?
-
Unlocking an AD account via a web page?
Legacy99 replied to ICANSEEYOU7687's topic in AutoIt General Help and Support
We looked at a self serve option, one company we worked with called Ensim did exactly that. The way they did it is via a Proxy account on a non AD server but it had full rights AD. The users however, would have had to visit the initial site to setup securty questions. Once that was done it was all stored in a SQL DB. Scripts would run once the transaction was complete to unlock the account. After seeing it done it didn't look to hard to replicate, however they also modified GINA so you could unlock your account from your own workstation, that part would be the challenge. Keep in mind that this was all on XP, not sure how it would translate to Vista/7. The other consideration is the account you provide for AD will be exposed on the website without this model. That was one security hole that veto'ed the in house solution for us. Cost was the reason for the third party app. -
Windows user account or string matching
Legacy99 replied to pieterisme's topic in AutoIt General Help and Support
Seconded, You beat me to it WMI is your friend. For more examples look up Scriptomatic. -
Reading files to listviews help
Legacy99 replied to Particle's topic in AutoIt General Help and Support
$TXT = FileOpen($Open,0) <- You don't need to open the file, you locked it and FileReadToArray can't read it now. -
Preventing concurrent logins script
Legacy99 replied to jazzyjeff's topic in AutoIt General Help and Support
Why not just create a text file on a server share EG. \\server\logononceshare$\@username.txt and write the computername (@computername) inside the file (or some other attribute like MAC address). Do an if statement- IF FILEEXISTS("\\server\logononceshare$\" & @username. & "txt") THEN ;Open the file, $fLogonFile = FileOpen(("\\server\logononceshare$\" & @username. & "txt",0) ;check if the computer name matches and if it does not match, $Line = Filereadline($fLogonfile, 1) If $line <> @computername Then Run("cmd /c shutdown /l /f") Endif ;some other house keeping stuff if you want to map drives, etc ;Create the file on the share as the last step $fCreatePass = Fileopen("\\server\logononceshare$\" & @username. & "txt", 1) Filewriteline($fCreatepass, @computername) If it does match let them log on (just in case the file got left behind due to a power outage, BSOD, etc) Then on your log off script, check if the file exists and check the computer name logged in the file, If both are true, delete the file. You can then use your CSV to track logons so you know when there are duplicate logons happening. If you want to get fancy, use INI files and "Encrypt" the data in the keys you create. -
Logon script Windows server 2003
Legacy99 replied to strikey's topic in AutoIt General Help and Support
IMHO - Kixtart would be a better choice for logon script as you can use the INGROUP function. It can also detect nested groups (Groups that are members of other Groups). Autoit can do it but you will need to create a lot of your own code that Kixtart can do in 2 lines. You could call a Kixtart script to enumerate the groups and have it pipe the results back to Autoit if you really wanted to use Autoit and didn't want the learning curve of ADFunctions.au3 -
If it were me I'd be looking in the registry for an uninstall switch on the installer for that software. Start here HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Try it with a /quiet or /S switch if you find it. Juniper must have documentation on how to remove it through command line.
-
Help with apostrophe in variable
Legacy99 replied to kodius's topic in AutoIt General Help and Support
$ProgramName = "Malwarebytes' Anti-Malware" -
I've got more than 300 Au3 scripts that ran from SCCM for 3 different clients ranging from anything like checking a registry entry to deploying Office 2007. Post your code, you will probably get lots of suggestions.
-
Here is where you change the computer name for a non domain connected XP pc. RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName","REG_SZ",$PCNAME) RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","NV Hostname","REG_SZ", $PCNAME) Here what you can use to set your IP's RunWait (@ComSpec & " /c " & "netsh interface ip set address Local static " & $PCs_IP & " " & $PC_Subnetmask & " " & $PC_Gateway & " 1", @SystemDir) RunWait (@ComSpec & " /c " & "netsh interface ip set dns Local static 192.168.0.1") RunWait (@ComSpec & " /c " & "netsh interface ip add dns Local 192.168.0.2")
-
Are you running any kind of Antivirus the prevents execution of .exe files from Temp directories? I know newer version of McAfee has this ability.