Jump to content

MadBoy

Active Members
  • Posts

    819
  • Joined

  • Last visited

Reputation Activity

  1. Like
    MadBoy got a reaction from oneLess in Delete Folder Contents   
    Try this one then? I've added removal of -A attribute and as you notice all the files in Content.IE5 have that attribute. Should work

    #Include <File.au3> _DirRemoveContents(@UserProfileDir & '\Local Settings\Temporary Internet Files\Content.IE5') Func _DirRemoveContents($folder) Local $list_of_contents, $status $list_of_contents = _FileListToArray($folder) If IsArray($list_of_contents) Then If StringRight($folder, 1) <> "\" Then $folder = $folder & "\" If @error = 1 Then Return 1 ; No Files\Folders Found For $a = 1 To $list_of_contents[0] FileSetAttrib($folder & "\" & $list_of_contents[$a], "-RASH") If StringInStr(FileGetAttrib($folder & $list_of_contents[$a]), "D") Then $status = DirRemove($folder & $list_of_contents[$a], 1) Else $status = FileDelete($folder & $list_of_contents[$a]) EndIf Next Else Return 2 ; Directory doesn't exists EndIf EndFunc ;==>_DirRemoveContents
  2. Like
    MadBoy got a reaction from szfzafa in Internet Explorer setting to always open maximized   
    Hopefully this will get useful for others as it did for me. My collegue found out which registry entry is responsible for Maximized option in IE and so I've scripted it.

    To change the Internet Explorer setting to always open maximized you have to first 18 chars from the value as described below:
    -> HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Window_Placement", "REG_BINARY"

    When IE window is not maximized the key value is similar to this: 2C0000000000000001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF160000001D0000003603000075020000
    When IE window is maximized the key value is similar to this: 2C0000000200000003000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF160000001D0000003603000075020000

    The only thing that changes is first 18 chars. Simply replacing them works as descrbed.

    NOTE: the values after FFFFF are changing constantly depending on user settings so it will vary for every computer/user.

    NOTE on the script. The script returns 1 if failed to change the key and returns 0 if everything is okey.


    Global $reg_read, $reg_write Global $reg_value = "2C0000000200000003" $reg_read = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Window_Placement") If $reg_read <> "" Then $reg_write = RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Window_Placement", "REG_BINARY", $reg_value & StringTrimLeft($reg_read, 18)) If $reg_write = 1 Then Exit(0) EndIf Exit(1)
    Regards,

    MadBoy
  3. Like
    MadBoy got a reaction from Synapsee in How to detect a 64-Bit OS   
    Well from what i tested ProcesorArch returns 32Bit or 64bit depending on Windows version and not actual state of your processor. I can test it in few minutes but i am sure i tested it some time ago.


    Edit:

    Just tested @ProcessorArch on Windows XP 32bit on Athlon64 returns X86. So i guess it's what you need


    Func DetectInfrastructure() If @OSTYPE = "WIN32_WINDOWS" Then ;If @OSType = "WIN32_NT" Then _AddLineBox("Unsupported Windows version. Use only on 2000/XP/2003 x32/64.") $ErrorIsThere = "Yes" Else If @ProcessorArch = "X86" Then $HKLM = "HKEY_LOCAL_MACHINE" $devcon = $devcon32 If @OSVersion = "WIN_XP" Then _AddLineBox("Detecting Windows version - Windows XP x32") If @OSVersion = "WIN_2000" Then _AddLineBox("Detecting Windows version - Windows 2000 x32") If @OSVersion = "WIN_2003" Then _AddLineBox("Detecting Windows version - Windows 2003 x32") EndIf If @ProcessorArch = "X64" Then $HKLM = "HKEY_LOCAL_MACHINE64" $devcon = $devcon64 If @OSVersion = "WIN_XP" Then _AddLineBox("Detecting Windows version - Windows XP x64") If @OSVersion = "WIN_2000" Then _AddLineBox("Detecting Windows version - Windows 2000 x64") If @OSVersion = "WIN_2003" Then _AddLineBox("Detecting Windows version - Windows 2003 x64") EndIf EndIf EndFunc ;==>DetectInfrastructure
    Replace _AddlineBox with your code
×
×
  • Create New...