Open a Folder in Air 2.7

Hello there,
When Air 2.0 was released, it was possibile to do something like this (c:\mydirectory\mysubdirectory has to be there obviously):
var file:File = new File("c:\\mydirectory\\mysubdirectory");
file.openWithDefaultApplication();
and the directory would be opened by using (for exampe) in windows the file explorer
In air 2.7 this code throws an error (that is a security error, in fact if I open a temp directory created with createTempDirectory it works)
"Illegal file path"
Now, please, tell me how can I harm the user by simply opening a directory on his hard disk!
How can I open a directory on his hard disk without getting this error?
Thanks in advance

Hi,
I think that "Illegal file path" is usually thrown when wrong path is submitted to File constructor - not when using that file/directory. Your method works for me e.g when using quick test:
var file:File = File.desktopDirectory;
file.openWithDefaultApplication();     
You could try also below solution that uses shell integration with Windows Explorer (Explorer.exe):
var file:File = File.desktopDirectory;
var path:String = file.nativePath;
var processInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var arguments:Vector.<String> = new <String>[path];
processInfo.arguments = arguments;
processInfo.executable = new File("c:\\Windows\\Explorer.exe");
var process:NativeProcess = new NativeProcess();
process.start(processInfo);
(above version requires "desktopExtended" and native installer on deployment due to use NativeProcess)
How to use Explorer.exe, e.g.:
http://support.microsoft.com/kb/152457
hth,
kind regards,
Peter

Similar Messages

  • Cannot open one folder via my harddrive on my new macbook air, but opens find on old macbook. It says "can't be opened because you don't have permission to see its contents."

    Hey guys,
    trying to open a folder on my harddrive full of photos but it comes up with "can’t be opened because you don’t have permission to see its contents."
    ive tried making all permissions 'read & write' on both computers and ive also tried clicking the lock in get info section on both computers.
    all the other folders on the harddrive containing photos are fine to open just this one for some reason
    help please
    cheeeeers

    Hey elmsy,
    Here is an article with some helpful information about troubleshooting permissions issues in OS X:
    Troubleshooting permissions issues in Mac OS X
    http://support.apple.com/kb/HT2963
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • How To Open A Folder of native system

    Hello Frnds can any body guides me how to open a folder of my system.actually i am using adobe air 2.0 for making a simple application in which i send and recived files.I simply uses File Class for extarct the nativepath of file.now i have path where my downloaded file stored.so Please tell me how to open the file or File Containg folder similary sevral aother web application does.
    Thanks In Advance
        Vineet Osho

    For opening the file itself, AIR 2.0 gives you a method in the File class called File.openWithDefaultApplication():
    openWithDefaultApplication
    method
    public function openWithDefaultApplication():void
    Language Version:
    ActionScript 3.0
    Runtime Versions:
    AIR 2
    Opens the file in the application registered by the operating system to open this file type
    The method description goes onto to talk about restrictions on file types in different operating systems.
    As far as opening a directory and performing some action on its contents, you can use the method File.getDirectoryListing(). This returns an array of File objects. You can test each File object with the isDirectory property, if you are interested in finding and dealing with sub-directories.
    Bill

  • Commenting functionality not available when I open a pdf in air application

    commenting functionality not available when I open a pdf in
    air application. Adobe documentation says that is expected with
    adobe air 1.0 but I still have the same problem even if I use the
    latest air runtime

    Back up all data.
    In the Finder, select Go ▹ Go to Folder from the menu bar, or press the key combination shift-command-G. Copy the line of text below into the box that opens, and press return:
    /Library/Internet Plug-ins
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    I've seen an unconfirmed report that the "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you might need to remove it as well, if applicable.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Getting this error while opening a folder : This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel

    Hi,
    While trying to open a folder on my Windows 7 Home Premium, an error comes "This file does not have a program associated with it for performing this
    action.  Please install a program or, if one is already installed, create an association in the Default Programs control panel." I tried searching on the net but did not get great support for the issue when it happens with folder opening.

    Hi Nikunj Shah,
    First, I suggest you download
    Microsoft Safety Scanner or
    Malicious Software Removal Tool to run a full scan.
    The error messages here seems to be caused by the corrupted registries, which related with the folder association.
    You may take a try to merge the following registry settings to reset the folder association, before that, remember to backup your registry settings first:
    How to back up and restore the registry in Windows
    Copy and paste the following commands into Notepad, and save it to a .reg file:
    =================
    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\Folder]
    "ContentViewModeLayoutPatternForBrowse"="delta"
    "ContentViewModeForBrowse"="prop:~System.ItemNameDisplay;~System.LayoutPattern.PlaceHolder;~System.LayoutPattern.PlaceHolder;~System.LayoutPattern.PlaceHolder;System.DateModified"
    "ContentViewModeLayoutPatternForSearch"="alpha"
    "ContentViewModeForSearch"="prop:~System.ItemNameDisplay;System.DateModified;~System.ItemFolderPathDisplay"
    @="Folder"
    "EditFlags"=hex:d2,03,00,00
    "FullDetails"="prop:System.PropGroup.Description;System.ItemNameDisplay;System.ItemTypeText;System.Size"
    "NoRecentDocs"=""
    "ThumbnailCutoff"=dword:00000000
    "TileInfo"="prop:System.Title;System.ItemTypeText"
    [HKEY_CLASSES_ROOT\Folder\DefaultIcon]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
      65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,00,00
    [HKEY_CLASSES_ROOT\Folder\shell\explore]
    "MultiSelectModel"="Document"
    "ProgrammaticAccessOnly"=""
    "LaunchExplorerFlags"=dword:00000018
    [HKEY_CLASSES_ROOT\Folder\shell\explore\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    [HKEY_CLASSES_ROOT\Folder\shell\open]
    "MultiSelectModel"="Document"
    [HKEY_CLASSES_ROOT\Folder\shell\open\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,78,00,\
      65,00,00,00
    [HKEY_CLASSES_ROOT\Folder\shell\opennewprocess]
    "MUIVerb"="@shell32.dll,-8518"
    "MultiSelectModel"="Document"
    "Extended"=""
    "LaunchExplorerFlags"=dword:00000003
    "ExplorerHost"="{ceff45ee-c862-41de-aee2-a022c81eda92}"
    [HKEY_CLASSES_ROOT\Folder\shell\opennewprocess\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    [HKEY_CLASSES_ROOT\Folder\shell\opennewwindow]
    "MUIVerb"="@shell32.dll,-8517"
    "MultiSelectModel"="Document"
    "OnlyInBrowserWindow"=""
    "LaunchExplorerFlags"=dword:00000001
    [HKEY_CLASSES_ROOT\Folder\shell\opennewwindow\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\BriefcaseMenu]
    @="{85BBD920-42A0-1069-A2E4-08002B30309D}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location]
    @="{3dad6c5d-2167-4cae-9914-f99e41c12cfa}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Offline Files]
    @="{474C98EE-CF3D-41f5-80E3-4AAB0AB04301}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\DragDropHandlers\{BD472F60-27FA-11cf-B8B4-444553540000}]
    @=""
    [HKEY_CLASSES_ROOT\Folder\ShellEx\PropertySheetHandlers\BriefcasePage]
    @="{85BBD920-42A0-1069-A2E4-08002B30309D}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\PropertySheetHandlers\Offline Files]
    @="{7EFA68C6-086B-43e1-A2D2-55A113531240}"
    [-HKEY_CLASSES_ROOT\Folder\ShellNew]
    [HKEY_CLASSES_ROOT\Folder\ShellNew]
    "Directory"=""
    "IconPath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
      74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
      00,68,00,65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,\
      00,00
    "ItemName"="@shell32.dll,-30396"
    "MenuText"="@shell32.dll,-30317"
    "NonLFNFileSpec"="@shell32.dll,-30319"
    [HKEY_CLASSES_ROOT\Folder\ShellNew\Config]
    "AllDrives"=""
    "IsFolder"=""
    "NoExtension"=""
    ==================
    Once done, right-click the REG file and choose Merge. Alternately, you can open the Registry Editor and then using the
    Import option from the File menu, to merge the REG file contents.
    Let me know if you need any further help.
    Best regards
    Michael Shao
    TechNet Community Support

  • I want to open a folder in a separate window by clicking on it.  For some reason when I click on a folder it just replaces the one I was just in.  I want them both to be open at the same time without having to go through several steps.

    I want to open a folder in a separate window by clicking on it.  For some reason when I click on a folder it just replaces the one I was just in.  I want them both to be open at the same time without having to go through several steps. Old apple operating systems made it easy to have several folders open at one time. 

    Eric, thanks that works but seems like an extra added step also to do it that way.  I've got to move and organize a ton of files and I'm looking for a easy way to get this done.  I could also open the folder into a separate tab and then drag the tab out so it becomes an open window but thats a lot of fussing around also with extra steps.  Not sure why these newer operating system seems more confusing and less user friendly than what they used to.  In the past I could just click on any folder and it would open in a separate window making it really easy to copy or move files from one place to the other just by simply dragging them from one window to the other.  Seems like I'm going through several extra steps now to do a simple task. 

  • I have tried to download Mavericks on my 2010 iMac(10.6.8), but nothing happens, not even the install app downloads, also I tried to download chrome, I moved it to the applications folder and when I opened the folder it wasn't there

    I have tried to download Mavericks on my 2010 iMac(10.6.8), but nothing happens, not even the install app downloads, also I tried to download chrome, I moved it to the applications folder and when I opened the folder it wasn't there. I have a 1tb hard drive that is mostly empty. By the way I just got this imac used from a reseller.

    Mavericks downloads into the Applications folder, where you can install it.   Some Mac App Store Troubleshooting information and how to resume a download that was interrupted; some of the information here might get you an answer.   Failing that, try contacting Apple Support.

  • Firefox 4.01 downloads files but the downloads windows greys out the "Open" and "Open containing folder" options and I can't trace the files

    Three days ago I upgraded to Firefox 4.01. I downloaded several files that were ok. Yesterday and today I downloaded one powerpoint file and a an apple *.dmg file.
    On the Download window these two files I can see with the total mb in size. However when I right click the file list in the Download window the "Open" and "Open containing folder" options are greyed out. What is more I cannot find these files anywhere on my computer when I use Windows Explorer to search.
    It seems that this happened after I tried to download a Firefox add on from http://releases.mozilla.org/pub/mozilla.org/addons/64761/amazonassist-0.7.2.6-fx.xpi and my antivirus picked up the JS/Kryptik.AK trojan and terminated the connection. Is there a link with the problem I am experiencing?
    I use Windows 7 professional, Firefox 4.01

    You're welcome

  • "Open each folder in the same window" not working

    hey guys, just today, I noticed that whenever i double click a folder, it opens in a new window.  I went to folder properties, and made sure I checked "Open each folder in the same window," and its checked.  I tried switching it on, then off, then restoring all defaults in both those settings and the view settings, and I've tried restarting the computer, even using a system restore point.  No Matter what, whenever I double click a window, it opens in a new window, but if I use the navigation pane, or if I highlight a window and click the open button at the top left, it opens in the same window.  This is very very very annoying, because just navigating my harddrive, I might end up with 20 windows open to reach just 1 file.
    Does anyone know what's wrong?  or how I can fix this? 

    I was experiencing this same issue on my laptop and spent several frustrating hours of searching in vain for a solution. I tried most of the same fixes mentioned here with no success (re-registering DLL's, running the system file checker [sfc /scannow],
    turning off the navigation pane, performing virus scans, etc). After almost giving up, I discovered that I only experienced this behavior when I accessed Explorer from the shortcut which was pinned to my taskbar. When I opened the "Computer" shortcut
    on my desktop, I was able to open individual folders without having new windows open each time. I suspect that this is related to the new design/function of the taskbar in Windows 7. To get the results I wanted, I opted to revert to the "classic" style
    taskbar seen in Windows Vista (AKA the "Quicklaunch" toolbar) by following the instructions here:
    http://www.howtogeek.com/howto/windows-7/add-the-quick-launch-bar-to-the-taskbar-in-windows-7/
    Then, I simply added a new shortcut to "Computer" in the new Quicklaunch toolbar and, "Voila!" - problem solved. Oddly enough, I don't experience the same behavior on my desktop PC which is also running Windows 7. Ain't Microshaft grand?!? (a-hem)

  • Adobe photoshop,word, and excel  won't open on my 2010 air mac

    adobe photoshop,word, and excel  won't open on my 2010 air mac. Message says I have lost my power pc connection. this happened while in Mexico

    Adobe Photoshop CS2, MS Word 2004 and other PPC apps running in Snow Leopard Server installed into Parallels  for use in Lion or Mt. Lion:
                                  [click on image to enlarge]
    More information here:
    http://forums.macrumors.com/showthread.php?t=1365439

  • Safari and iTunes will not open on my Macbook Air after Migration Assistant

    I did the Migration Assistant via wireless (from Macbook Pro TO Macbook Air) last night and it did work. However, my Safari and iTunes will not open on my Macbook Air now. The error messages are as follows:
    Safari: "Safari quit unexpectedly. Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple."
      - I tried reopening the app, restarting, and shutting down the computer. Nothing has worked.
    iTunes: "The file 'iTunes Library.itl' cannot be read because it was created by a newer version of iTunes. Would you like to download iTunes now?"
      - I clicked "Download iTunes" but then another message comes up that all my software is up to date.
    Any help is very appreciated.

    Try repairing permissions using Disk Utility.

  • Why is firefox opening a folder and disc every time i launch it

    why is firefox opening a folder and disc onto my desktop every time i launch it
    == This happened ==
    Every time Firefox opened
    == with the new version

    Let's start simple. Are you sure you are not clicking on the firefox dmg file?
    See [[Installing Firefox on Mac]]

  • When opening a folder, its takes ages to show the files

    Hi All,
    I have a 2012 Macbook Pro running Lion (as you can probably guess!), with a 512Gb SSD and 8Gb Ram. Its a pretty fast machine and i'm really happy with the way it runs, however when I open a folder to view files, it opens and shows a blank folder and then I get the black pinwheel in the bottom left/right hand side and I have to wait for sometimes over 30 seconds before the files in that folder are shown!?
    Does anyone have any ideas why this happens? One thing to point out is that it doesn't always happen and its not restricted to particular folders. I can open a folder and it will show the files straight away, however I can re-open that folder and it will take up to 30 seconds to show the files...
    I've tried rebooting and running nothing, but it still happens. And I have also tried the normal disk utilities to check permissions, etc and I think these are fine too..
    You guys are my last hope before I start to talk to apple and log a support call - Help!
    Cheers

    First off, I do not recommend looking at your time machine while it is running.  You can tell if it is running by making sure its menubar icon is shown in Apple menu -> System Preferences -> Time Machine.  If the icon is moving, it is running.   You can manually backup, which I recommend over automatic backup, as automatic backup can get in your way.   Spotlight, if it is indexing (check the menu in the upper right that looks like a magnifying glass), will also slow matters down, and adding things you don't want Spotlight to search to your Apple menu -> System Preferences -> Spotlight -> Privacy pane will help.  Note this affects areas you can search in Time Machine as well.  If searching content of files is of little interest to you, I find Find Any File much quicker for finding by file name.   Backup when you aren't doing anything else, as otherwise, you may find yourself backing up files that haven't had the opportunity to close.
      Time Machine also works best if your destination drive is at least twice as capacious as your source drive.   Otherwise it is spending a lot of time trying to find places for the archived files, and barely is more archival than a simple clone.

  • I do not know how to open a folder, file !

    Hi  everyone,
    I do not know how to open a folder, file or
    a JavaScript  program in photoshop cs4?
    can you tell me how to proceed
    Thank you

    thank zhpingw
    the script not function unfortunately
    I had to go  through to have a flash file. swf
    I put in a  url link
    file. swf I was put in the palette and  its works!
    Download This file tutoweb. link . swf
    requete  content  for Google find tuto a Photoshop !
    Warning you change to script Google.fr  for Google.uk  in file .fla
    Place to swf in your palet of configurator
    Enjoy
    http://rapidshare.com/files/390041665/Flash_CS4.rar

  • I can see my thumbnails for my events in iphoto, but when I click to open the folder, no photos show up. However, when I hover over the thumbnail, it shows the flicker of images that should be inside the folder, as well as

    I can see my thumbnails for my events in iphoto, but when I click to open the folder, no photos show up. However, when I hover over the thumbnail, it shows the flicker of images
    that should be inside the folder, as well as # of images in each folder. It also occasionally says the following when I try to even open iphoto:  "Your photo library will not be readable by previous versions of iPhoto after the upgrade. The upgrade process for very large libraries may take an hour or more to complete." So, I am scared to hit "upgrade" for fear I will never recover any of the images as the wording in this quote seems odd. The photos are not in the trash. Did I lose them all? Do you know if/how I can retrieve them?

    iPhoto 08?
    Try these in order - from best option on down...
    1. Do you have an up-to-date back up? If so, try copy the library6.iphoto file from the back up to the iPhoto Library (Right Click -> Show Package Contents) allowing it to overwrite the damaged file.
    2. Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    3. If neither of these work then you'll need to create and populate a new library.
    To create and populate a new *iPhoto 08* library:
    Note this will give you a working library with the same Events and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
    In the iPhoto Preferences -> Events Uncheck the box at 'Imported Items from the Finder'
    Move the iPhoto Library to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library (Right Click -> Show Package Contents) on your desktop and find the Originals folder. From the Originals folder drag the individual Event Folders to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption.

Maybe you are looking for

  • Back button, forward refresh all do not work

    Back and forward buttons are constantly greyed-out: back and forward are also greyed-out in the right-click menu. Reload button and right-click can be pressed, it does nothing. I've uninstalled, reinstalled, switched profiles, and uninstalled all add

  • MobileMe Galleries showing up in Multiple Libraries

    I publish MobileMe galleries from different computers to my MobileMe account and those computers have multiple Aperture Libraries. I have noticed that some of my Aperture Libraries sync my MobileMe galleries that were created on different computers o

  • My Macbook crashed and I can't figure out....

    I had iWeb and a whole website all done. Domain name and all... just a perfect personal site. My Macbook crashed. I got a new hard drive installed and am going thru re-installing and re-setting things to my liking... and when I open iWeb and put in m

  • Acrobat Forms - Capital Letters throughout

    I have a form in which each field needs to be completed in capital letters, and wanted to force this through validation scripting - but I cannot work out how. Can someone help me please?

  • ? migrating from Logic 8 on Mac G5 to Logic 9.1 Mountain Lion on new Intel Mac

    I'm migrating from a non-Intel Mac G5 PPC  with retail Logic Pro 7 installed and also the upgrade to Logic 8. What is the best way to install Logic on my newly acquired July 2011 Quad-Core Mac Mini Server ( MMS ) ? I have the original install disks f