Hide known file extensions

Cem_KaraerCem_Karaer Member Posts: 281
Hello,

Is there any automation object to determine if the current system's folder option "Hide extensions for known file types" is checked or not?
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005

Answers

  • SogSog Member Posts: 1,023
    if you know where this option is saved in the registry, You could use the objShell automation. Search for shell on mibuso.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • pduckpduck Member Posts: 147
    Use the Registry:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Advanced\HideFileExt

    0 = Show
    1 = Hide

    You can define an automation variable of type "Microsoft Script Host Object Model" to read from the Registry. http://support.microsoft.com/kb/244675
  • Cem_KaraerCem_Karaer Member Posts: 281
    Thank you for your help. Here is the test CodeUnit utilizing the object.
    OBJECT Codeunit 50000 Test
    {
      OBJECT-PROPERTIES
      {
        Date=03.12.10;
        Time=15:50:57;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        OnRun=BEGIN
                IF ISCLEAR(WshShell) THEN
                  CREATE(WshShell);
    
                Result := WshShell.RegRead('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt');
              END;
    
      }
      CODE
      {
        VAR
          WshShell@1103301001 : Automation "{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} 1.0:{72C24DD5-D70A-438B-8A42-98424B88AFB8}:'Windows Script Host Object Model'.WshShell";
          Result@1103301000 : Boolean;
    
        BEGIN
        END.
      }
    }
    
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
Sign In or Register to comment.