Jump to content

drorshem

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by drorshem

  1. Hi, I'm looking to create a script which will download all *.txt files from a remote FTP server. Once downloaded, delete all *.txt files. Can this be achieved using AutoIt ?
  2. Works Perfectly =) However, I wish there was a way to remove the: Windows Registry Editor Version 5.00 from each one
  3. Hi, I am having trouble with exporting several registry keys to one text file. For example I have: ShellExecuteWait("regedit.exe","/e registry.txt HKEY_CLASSES_ROOT\.ico", @DesktopDir) ShellExecuteWait("regedit.exe","/e registry.txt HKEY_CLASSES_ROOT\.eml", @DesktopDir) ShellExecuteWait("regedit.exe","/e registry.txt HKEY_CLASSES_ROOT\.txt", @DesktopDir) It only saves the last one (txt) in that file. Is there a way to save all of them into one file? Thanks in advance!
  4. Thanks to both of you... Will learn from my mistakes
  5. Hi, I am trying to create a txt file which will include all startup applications. I have managed to do so, but it only works in Windows 7. I get this error while trying to run it in Windows XP: --------------------------- AutoIt Error --------------------------- Line 1119 (File "C:\Documents and Settings\user\Desktop\1.exe"): Error: Subscript used with non-Array variable. --------------------------- OK --------------------------- Any Ideas ? #include <array.au3> #include <file.au3> FileOpen("1.txt", 1) $StartupInfo = FileOpen("1.txt", 1) FileWrite($StartupInfo, "Startup Applications:" & @CRLF & @CRLF & @CRLF) Func _LogStartupItems($_outputFile, $_runKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run") Local $_itemCount = 1 Local $_itemPath Local $_itemName = RegEnumVal($_runKey, $_itemCount) While Not @error $_itemCount += 1 $_itemPath = RegRead($_runKey, $_itemName) If Not @error Then FileWriteLine($_outputFile, $_itemName & " --- " & $_itemPath) EndIf $_itemName = RegEnumVal($_runKey, $_itemCount) WEnd EndFunc Dim $myStartupKeys[5] $myStartupKeys[0] = 4 $myStartupKeys[1] = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" $myStartupKeys[2] = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" $myStartupKeys[3] = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" $myStartupKeys[4] = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" For $i = 1 To $myStartupKeys[0] _LogStartupItems($StartupInfo, $myStartupKeys[$i]) Next $Location = @StartupDir $FileList = _FileListToArray($Location, "*", 1) If @error Then Endif Local $FileOpen = $StartupInfo, $Data For $i = 1 To $FileList[0] $GShortcut = FileGetShortcut($Location & "\" & $FileList[$i]) $Data &= $FileList[$i] & " - " & $GShortcut[0] & @CRLF Next FileWrite($StartupInfo, $Data) FileClose($FileOpen) FileClose($StartupInfo) Thanks in advance!
  6. Works perfectly now - thanks a lot
  7. Thanks, but for some reason all files comes up as 0.0.0.0 file version
  8. Yes I know, but how do I append it to each line/file, directly to the text file? Can you help please?
  9. Basically what I wish to perform is to get a file list from a folder (System32 for example), get the file version of each file, and write it to a text file to appear like that: aaclient.dll 6.1.7600.16385 accessibilitycpl.dll 6.1.7600.16385 I guess that I need to use _FileListToArray, than _FileWriteFromArray like that: $FileList = _FileListToArray(@SystemDir) _FileWriteFromArray(@DesktopDir & "\file-list-system32.txt", $FileList, 1) But my question is, how do I get the file version to appear as well? If you have a different idea, I will be more than happy to hear it. Thanks !
  10. The @TAB was just a try, you can replace it with a space or anything that will help getting this in the right alignment with the rest of the lines. I hope I got my self clear on this matter. Thanks again.
  11. I would rather it to be a text file. I've already managed to do this in HTML / XLS & CSV. But not yet in txt file. Hope you can help
  12. Hi, I am kind of new here, and have created already some tools that helped me a lot during the day. However, I am having tough time getting this one right. I have the following: $file = FileOpen(@TempDir & "\sysinfo.txt", 1) ; Operation System FileWrite($file, "Operation System - " & @TAB & @OSVersion & @CRLF) ; Physical Memory Installed FileWrite($file, "Physical Memory Installed - " & @TAB & Round(GetMem() / 1024 ^2, 0) & " MB" & @CRLF) Func GetMem($srv = "localhost") Local $mem, $colItems, $colItem, $ping, $x $ping = Ping($srv) If $ping Then $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $srv & "\root\cimv2") $colItems = $objWMIService.ExecQuery("Select Capacity from Win32_PhysicalMemory", "WQL", 0x30) If IsObj($colItems) Then For $objItem In $colItems $mem += $objItem.Capacity Next Return SetError(0, 0, $mem) Else Return SetError(2, 0, 0) EndIf Else Return SetError(1, 0, 0) EndIf EndFunc ; Internet Explorer version Local $ieVersion = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") FileWrite($file, "IE version - " & @TAB & $ieVersion & @CRLF) ; Firefox version Local $ffVersion = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox', 'CurrentVersion') FileWrite($file, "Firefox version - " & $ffVersion & @CRLF) FileClose($file) Which gives me the following text file: Operation System - WIN_7 Physical Memory Installed - 2048 MB IE version - 8.0.7600.16722 Firefox version - 3.6.13 (en-US) But I want it to be array like this: Operation System WIN_7 Physical Memory Installed 2048 MB IE version 8.0.7600.16722 Firefox version 3.6.13 (en-US) I've tried several ways offered here, but could get it right yet. How can I do it ? Thanks for the help! - Love it here!
×
×
  • Create New...