How to retrieve the  drive letter of the current directory with an applet ?

The subject says it all.
I have this html file and when launched it should get the current drive's letter.
This is how it's done in java, but I dunno how to make it in an applet version.
import java.*;
import java.io.File;
public class test {
public static void main (String args[]) {
File dir1 = new File (".");
String drive = new String();
try {
drive = dir1.getCanonicalPath ();
char driveletter = drive.charAt(0);
System.out.println ("Drive letter : " + driveletter);
catch(Exception e) {
e.printStackTrace();
Thank you very much for any hint or any idea.
Gihan.

Found the solution, used getCodeBase.
Thank you.
Gihan.

Similar Messages

  • When changing the drive letter for the ipod itunes still wont come up

    when changing the letter a couple of times itunes wont come up and trying to restore it nothing happens i have reinstalled itunes like 12 times and the 6/28/06 software messed me up i dont know what to do when i turn on my ipod its like i barley got it from the store when i hook it up and change it when i take it off it does that what should i do i need some help please someone i cant do this anymore anything out there

    Try doing a Ctrl-Alt-Del, and in Task Manager click on the Processes tab. End the iTunesHelper and iPodService processes. Then reconnect the iPod and go into Disk Management, and the iPod should show up. Change the drive letter to something other than C, then eject the iPod and restart the computer. When you reconnect it you should be able to get it recognized.

  • How do I find out about the driver letter of a usb drive by script, given the DeviceID

    Hi all,
    I am wondering if it is possible by script to find out what the drive letter of a usb drive might be.
    I have just inserted my USB stick into a socked and the operating system displays that the drive was recognized and that the drive letter is F:.
    I already know, how USB devices can be listed by WMI script, but how do I extract the drive letter of a USB storage device.
    The DeviceID is known, where do I find the drive letter given the DeviceID ?
    Disk drive
    DeviceID:
    USBSTOR\DISK&VEN_SAMSUNG&PROD_YP-U2&REV_0100\4002FDCCE0E4D094&0
    Service: disk
    Status: OK
    SystemName: MEINER
    Caption: Samsung YP-U2 USB Device
    All help is welcome

    @echo off  
    :: GetLetterOFmyUSBstick.cmd  
    :: Bye Gastone Canali  
    ::DeviceID: USBSTOR\DISK&VEN_SAMSUNG&PROD_YP-U2&REV_0100\4002FDCCE0E4D094&0  
    setlocal EnableDelayedExpansion  
    set PNPDeviceID=4002FDCCE0E4D094 
    set Q='wmic  diskdrive where "interfacetype="USB" and PNPDeviceID like "%%%PNPDeviceID%%%""    assoc /assocclass:Win32_DiskDriveToDiskPartition' 
    echo %Q%  
    for /f "tokens=2,3,4,5 delims=,= " %%a in (%Q%) do (  
      set hd=%%a %%b, %%c %%d  
      call :_LIST_LETTER !hd!)  
    goto :_END  
    :_LIST_LETTER  
    (echo %1 |find  "Disk ") >nul|| goto :_EOF   
    for /f "tokens=3 delims==" %%a in ('WMIC Path Win32_LogicalDiskToPartition  ^|find %1') do set TMP_letter=%%a  
    set Part_letter=%TMP_letter:~1,2%   
    echo %Part_letter% %1  
    goto :_EOF  
    :_END  
    :_EOF  
    ' ' GetLetterOFmyUSBstick.vbs
    strComputer = "." 
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  
    strPnPdevID = "USBSTOR\DISK&VEN_SAMSUNG&PROD_YP-U2&REV_0100\4002FDCCE0E4D094&0" 
    strPnPdevID = Replace(strPnPdevID, "\", "\\")  
    Set colDiskDrives = objWMIService.ExecQuery ("SELECT * FROM Win32_DiskDrive where PNPDeviceID like '"& strPnPdevID &"' ")  
    For Each objDrive In colDiskDrives  
        Wscript.Echo "Physical Disk: " & objDrive.Caption & " -- " & objDrive.DeviceID   
        strDeviceID = Replace(objDrive.DeviceID, "\", "\\")  
        Set colPartitions = objWMIService.ExecQuery _  
            ("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & _  
                strDeviceID & """} WHERE AssocClass = " & _  
                    "Win32_DiskDriveToDiskPartition")  
        For Each objPartition In colPartitions  
            Wscript.Echo "Disk Partition: " & objPartition.DeviceID  
            Set colLogicalDisks = objWMIService.ExecQuery _  
                ("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _  
                    objPartition.DeviceID & """} WHERE AssocClass = " & _  
                        "Win32_LogicalDiskToPartition")  
            For Each objLogicalDisk In colLogicalDisks  
                Wscript.Echo "Logical Disk: " & objLogicalDisk.DeviceID  
            Next 
            Wscript.Echo  
        Next 
        Wscript.Echo  
    Next 

  • Hi, my Ipod Schuffle (4 gen) dissapears from windows vista right after I execute Itunes, I've change the drive letter, erase temps in App data file, verified USB drivers, etc... Can someone guide on how to solve this?

    Hi, my Ipod Schuffle (4 gen) dissapears from windows vista right after I execute Itunes, I've change the drive letter, erase temps in App data file, verified USB drivers, etc... Can someone guide on how to solve this?

    If you want the shuffle to be always visible in Windows (outside of iTunes), you need to Enable disk use.
    Select the shuffle in the iTunes sidebar, under DEVICES.  Over to the right, select the Summary tab.  You should see a checkbox that says Enable disk use.  Check it and click Apply.
    NOTE:  If disk use is enabled, you have to Eject the shuffle in iTunes, BEFORE you physically disconnect it.  If disk use is NOT enabled, you can disconnect the shuffle at any time, as long as iTunes is not doing something with it at that moment (such as syncing); the shuffle's light will then be blinking (to indicate DO NOT DISCONNECT).
    So, unless you want to use the shuffle like a USB flash drive (carry random files on it), you may want to NOT Enable disk use.

  • How do I assign a drive letter to the Ipad in Windows 8

    Hi,
    I deleted an important video file and some photos from my ipad.
    Last few days I have spent ages trying to find a utility that will recover the files, but most of the 'ipad specific' software is a crock.
    I thought if I could assign a drive letter to the Ipad when I connect it to me Windows 8 PC I could run any number of much more trsutworty and stable applications to try and recover the info. However, I have googled and googled and can't find a way to assign a drive letter to the Ipad.
    Can anyone advise if this is possible?
    thanks

    You cannot. The iPad is not considered a removable storage device and will not operate as such normally.
    There are software programs out there that will allow you to directly access the unit's internal memory. Google iFunBox. I don't know if it will give you low enough level file access to do what you want though and it certainly won't give you the ability to undelete files either. Whatever file access that's done is through iFunBox...you can't access the device (indirectly) through Windows Explorer (or Mac) even while running iFunBox.

  • How to get the drive letter of a Volume using command prompt

    Using windows command line tools i want to get the drive letter of a volume, by specifying its volume number.
    For example i have a HDD with 2 volumes: Volume-0 and Volume-1
    I want to set a Variable say 'Letter'=<Drive Letter> such as
    SET Letter=<Command> <Volume Number>
    Is there any command which can do this for me...
    Thanks...

    Hi,
    You can use the diskpart tool to assign a drive letter to the drive by specifying the volume's number.
    1.Open Command Prompt.
    2.Type:diskpart
    3.At the DISKPART prompt, type:list volume
    Make note of the number of the simple volume whose drive letter you want to assign, change, or remove.
    4.At the DISKPART prompt, type:select volume n
    Select the volume, where n is the volume's number, whose drive letter you want to assign, change, or remove.
    5.At the DISKPART prompt, type one of the following:assign letter=L
    Where L is the drive letter you want to assign or change.
    For more detailed information, you could refer to the article below:
    Assign, change, or remove a drive letter
    https://technet.microsoft.com/en-us/library/cc757491(v=ws.10).aspx
    Best Regards,
    Mandy 
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Copy the SQL Binaries and Data to another drive and then change the drive letter to previous drive letter

    Hi All,
    We have SQL Server 2012 SP1 installed on E drive (which means SQL Binaries, Database and LOGs) are in the same drive E, we are not able to backup the SQL Server because according to Backup Vendor their is a problem with the DISK E which is why the backup
    is not successful, We have added one more drive with the same space, we have stopped SQL Server services and copy each and every thing from E drive to new drive and changed the current E Drive to K and changed the new drive to E, after that when we tried to
    start SQL Service but it was not starting, we have again reverted back the original drive to E and service was successfully started, please note here that SQL server service logon is NT service / local service. Please help us that how to do achieve this as
    we are using the same E drive and OS should not know any thing. Please help us to copy and then change the drive letter to E so that we can delete the old drive.
    Thanks
    If answer is helpful, please hit the green arrow on the left, or mark as answer. Salahuddin | Blogs:http://salahuddinkhatri.wordpress.com | MCITP Microsoft Lync

    We have stopped SQL Server services and copy each and every thing from E drive to new drive and changed the current E Drive to K and changed the new drive to E, after that when we tried to start SQL Service but it was not starting,
    You should not have done this. Even if you install complete SQL Server on Separate dedicated drive few binaries would always go on system drive that is C drive so your idea of moving files to other drive would sure create a problem. As a fact you cannot
    move SQL Server complete installation from one drive to other apart from uninstalling and reinstalling again.
    Copy it back an hope fully you would be able to restart. Why should you take a product which allows you to change sql server drive its a bad product. I guess backup engineer does not how to configure backup agent
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Articles

  • I have version 3.6.16 and when I login to my hotmail account, and type the first letter of the email address, a drop down box appears with my hotmail address and I can choose it from that box with a click. How do I get version 4 to do this? Thanks.

    I have version 3.6.16 and when I login to my hotmail account, and type the first letter of the email address, a drop down box appears with my hotmail address and I can choose it from that box with a click.
    How do I get version 4 to do this?
    Thanks.

    The new but not-ready-for-prime-time autocomplete method searches for matches that contain the entered text, not just ones that begin with the string. Your options are:
    1) type in longer strings that narrow the search
    2) use an add-on to search just the beginnings:
    https://support.mozilla.org/en-US/questions/1037469
    3) install an older version of TB:
    http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/

  • How do I delete an email address from the dropdown that appears after I type the first letter of the recipiants address in the To: bar.

    When I open compose and type the first letter of the recipients address in the To: bar a dropdown appears with a listing of the email addresses I have sent messages to in the past as well as addresses of my contacts list.
    How do I delete an address from this dropdown?

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Can I set up a new Mac Pro late 2013 using a Wacom Cintique 13HD tablet as the default monitor? How would I install the driver software for the tablet?

    Can I set up a new Mac Pro late 2013 using a Wacom Cintique 13HD tablet as the default monitor? How would I install the driver software for the tablet?

    The wacom site will have the drivers for you.
    http://us.wacom.com/en/support/drivers

  • How to place an image in database and how to retrieve and display it in the front end

    how to place an image in database and how to retrieve and display it in the front end
    and to place an image in database and retrieve the image from database using xml
    please,help me out.

    Create a table with a Long RAW Datatype column for storing the Image Column Data.
    Create the form based on the table , which by defaults the column with LONG RAW atatype to a Image Item.
    You can use Forms Built in function READ_IMAGE_FILE to read a Image file stored on the file system in to the image item.
    A save on the form saves the image in the Image item in the long raw column.

  • I changed the drive letter on my iPod and now iTunes won't recognize it!

    Help please! I contacted an Apple associate and they told me to change the drive letter of my iPod in My Computer. I did that and now iTunes won't recognize my iPod at all and I can't change the drive letter back to the original one. What do I do?

    Try Resetting Your iPod while it's connected to the computer.
    Hold down the Menu and Select buttons until you see the Apple logo (or Menu & Play/Pause in older models).
    This will often get it recognized. It may take several attempts.
    Try closing and re-starting iTunes. There have been cases where iTunes refuses to see an iPod, but after re-starting, it works again.
    Also try re-booting the entire computer. Especially if the PC has been operating for a long time &/or many programs have been opened and closed, repeatedly.
    Other USB connected peripherals may be the cause as well. Try removing all connected USB items and attaching the iPod. If you have a USB keyboard, it may be worth a try using the adapter to convert it to non-USB. If the iPod connects, continue plugging things back in until you have the problem return. You may have then isolated the issue. Sometimes it could be a printer, camera, Flash Card reader, or other attached device causing a conflict.

  • Auto-Capitalization: How can I set Pages v5.01 to auto-capitalize the first letter of the first word in a sentence and to automatically change lower case "i" to "I" appropriately. I'm unable to find a menu that offers me these.

    Auto-Capitalization: How can I set Pages v5.01 to auto-capitalize the first letter of the first word in a sentence and to automatically change lower case "i" to "I" appropriately. I'm unable to find a menu that offers me these.

    Gavin Lawrie wrote:
    Once it had been established that the iWork rewrite had resulted in some features being lost and others broken, and once Apple had acknowledged the concerns* and suggested they are working on fixes**, I'm not sure what else there is to achieve.
    You are writing that in the perspective of having read about it here already. Repeated often enough that you encountered it somewhere in the posts.
    Users are flooding in here and don't know any of this. Of course we have to repeat everything endlessly.
    Because I like to give precise, understandable and workable answers to repeated questions, and Apple doesn't allow sticky posts here, I created a separate forum which users can consult to look up real answers, and contribute for themselves if they have something valuable to add:
    http://www.freeforum101.com/iworktipsntrick/
    There is a section purely devoted to Pages 5. Add whatever answers you feel will lighten the problems of Apple's 'upgrades'.
    Peter
    * Where have they acknowledged anything?
    ** They have barely anything listed, compared to the massive list of deleted features, and nothing but an extraordinarily long time frame considering they created the problems here and now. Apple has not said they will do anything at all about fixing the real issues, the biggest of which is that the new iWork apps break virtually all the work of existing users.

  • How can I get rid of the drop down suggestion box that appears as soon as I type the first letter in the address box?  Runnung 7.1.2

    How can I get rid of the drop down suggestion box that appears as soon as I type the first letter in the address box?  Runnung 7.1.2

    Writelady,
    I do not know of any such option. I don't think that it is even possible at this time, however it doesn't mean that maybe sometime in the future Apple or someone else will make a way to do such as your request.
    I do however think that you should let Apple know your opinion if you have not done such yet. You can give them product feedback at the following link. https://www.apple.com/feedback/safari.html
    I hope that this helps,
    -Weston

  • I had installed Adobe Photoshop on my macbook but had to erase the drive and lost the install files etc....how can I reinstall it?

    I had installed Adobe Photoshop on my macbook but had to erase the drive and lost the install files etc....how can I reinstall it?

    Photoshop version?
    Benjamin

Maybe you are looking for

  • Officejet 6700 error while searching for updates: 'Printer could not connect to server'

    I recently purchase the Officejet 6700 Premium. While setting the printer up, I received the error 'The printer could not connect to the server.' I first received this while the printer was searching for updates. I later received the same error while

  • Zen Vision M 30Gb Plz Help Me Out I Dont Know What To

    i bought the zen vision m about 9 months ago adn everything worked fine but now i try to charge it via USB and the wierd part is windows doesnt detect de player but the players blue lamp is flikking and sometime the battery shows up but it wont charg

  • Auto fill in Safari adding a space to my email address

    When I use AutoFill in Safari now it puts an extra space in front of my email address. I have checked several times in my address book, and my email address is entered correctly. I have retyped my email address and this doesn't fix it. Any help would

  • How to cpature hard deletes in custom table?

    Hello Team, We have custom table in SAP attached to the application tcode. As per business requirement, user can delete few items in transacation( hard deletes). We are planning to delete these records from custom table if user delete them in Tcode.

  • Scrollbar in FormsGraph PJC

    Hi, In which trigger should I put the following 'set_custom_property('PJC.SIMPLEGRAPH',1,'SCROLLBAR','true');' so that a scrollbar appears in PJC...? I put it on WHEN-NEW-BLOCK-INSTANCE of the control which contains the PJC i use for the graph with n