Problem in renaming file

hi
There are 2 files in a directory called
js1.html
js2.html
i am reading from js1.html and making some modification to
the data as i read and storing in js2.html
finally i have to rename js2.html to js1.html
i am using fileinputstream and fileoutputstream amd i am
closing both before ranaming.
I also am trying to delete js1.html before renaming
as both are in the same dir
The code i am using for renaming
File old=new File("js2.html");
old.renameTo(new File("js1.html");
But this always returns false
i am using win2k
could anyone pls help me out with this
thanks

Just a guess but maybe it is returning false because you already havea file named js1.html. Trying doing this through Windows Explorer and it will spit out an error.
What you should try is deleting js1.html first and then renaming. Presumably you don't need js1.html anymore once you make the changes so go ahead and delete it.

Similar Messages

  • Problem removing/renaming files.

    So I just recieved the Zen. I uploaded a good amount of my music library via WMP but realized one of the albums from one of hte bands was its own folder. So I went to the Zen media player explorer, deleted the folder and moved a new copy of said folder where it should be. Theres just one issue. While on my explorer everything is as it should be, on the actual player it is still wrong. The files are not in their riteful place, and nothing changed at all. Any help?
    Also, how do you add album artwork on the Zen? Thanks alot.

    No, not a V Plus. Just a straight Zen. Under my computer, there is a Zen media explorer. Just really would like this issue where the changes/renaming or addition of album art would save. It saves on the computer, just not on the Zen. And how would you add outside album art in jpeg form using WMP?

  • Problem renaming File

    Hello,
    I have a problem about renaming file. This is the file.
    "C:\Documents and Settings\Rose 2\Desktop\download directory\5406-5473\a " . It has no extension so I need to add extension(.mp3). here's my code:
                File mFile = new File(soundFile.getParent(),"a.mp3");
                soundFile.renameTo(mFile);
                System.out.println(mFile.toString());
                if (mFile.exists()) {
                    setAudiofile(mFile);
                } else {
                    System.out.println("mFile does not exist");
                }the soundFile variable is the original file. The output of my code is nothing and I don't see a.mp3.
    Result of System.out.println(mFile .toString()) :
    C:\Documents and Settings\Rose 2\Desktop\download directory\5406-5473\a.mp3
    Thanks in advance and Happy New year!!!

    The output of my code is nothing and I don't see a.mp3.But you posted some output...
    Anyway try if (mFile.exists()) {
        System.out.println("mFile *does* exist");
        setAudiofile(mFile);
    } else {
        System.out.println("mFile does not exist");
    }What is the output?
    By the way, your code gives no hint as to what setAudiofile() does - including the possibility, albeit unlikely, that it deletes a.mp3. Rather than post a snippet excised from a longer piece of code, construct a SSCCE that illustrates renameTo() not working.
    http://homepage1.nifty.com/algafield/sscce.html

  • A litle problem with rename method.

    Hi everybody..
    I have a little problem with renaming files..
    I can rename files but it puts the new renamed files to BIN directory (where my program runs) whereever the path I opened the old-original image. I want to pu the "renamed file" where it belongs to,the orginal path, How can I handle with it?
    My code is like this..
    String renamestring = JOptionPane.showInputDialog ("Enter new name for image");
    File file2=new File(renamestring+".gif");
    boolean success = f.renameTo(file2);
    I have another question if you do not mind..How can I rename files with their orginal extensions?? for example in the above code ı rename all file with .gif extension, (if I Dont do that, it does not give any extension to the new renamed file..)
    thanks so much..

    Now, I'm a bit shaky on files, I've only used them to store dummy data, but here's my two cents.
    It's putting the files there because, as it appears from what you've cited as your code, you're using a relative filename. something like pic1.gif. This will be put whereever the program is running. What you want is to make your file using...
    String PATH_NAME = "<Directory you want it stored in>";
    File file2=new File(PATH_NAME + renamestring + ".gif");There are a few ways of getting where it should be saved, but since I'm not sure what system you're on, I'm not going to go into it. Simply put, I think you can just search from the back to the String (originalFile.getPath()) for the last folder deliminator (i.e. "\"), then take that and everything before it as the PATH_NAME.
    As for original extension, you can try the same thing. Start at the end of the file name using the String's lastIndexOf() function, and find the period. Then take the period and everything until the end of the string as a new String fileExtension.
    String PATH_NAME = "<Directory you want it stored in>";
    File file2=new File(PATH_NAME + renamestring + fileExtension);

  • Why can't I rename files?

    I have a sub folder that when I click any file in it, the file name doesn't highlight so I can change it.  If I go only one level out of the sub folder, there is no problem with renaming files.
    If I copy any of these files to another folder, I can rename them. 
    I'm an admin on this machine.  If I right click on any file in the sub folder, I have Read/Write access.
    Any ideas what is preventing renaming these files?

    Hi Th3r3ad3r,
    Could you please attach a screenshot of the same, where only one icon is active even after selecting that file? You can refer http://www.imore.com/screenshot-ipad for taking the screenshot.
    Thanks,
    -Shilpi

  • Cannot rename files, folders and drives

    tried to GRAB the error message, and it's hanged when I tried to save the image.....
    There are problems on rename files, folders and drives, also have problem to delete things....
    what can I do.....!!!!

    Ok, finally i just reboot the machine and it is fine now.
    I guess there are some bugs related to the user permissions...
    Indeed, I encountered a few bugs and they were fixed by rebooting the machine.
    More details: I am using a early 2008 version mac pro with mountain lion and upgrade os to mavericks last nite.
    At first, it cannot connect to my wifi network, it kept asking me to enter password for my network but kept saying it s failed. After trial to fix it by a few methods which were failed, i gave up and reboot, and vala~ It worked again..
    Then i tried to rename my system drive as it was named "mountain lion", and i just want to rename it to "mavericks", error popped out, and i found that i cant rename folders or files, or put them in trash.... Again, it worked again after reboot!!!!
    Guys, for those who wannna upgrade to mavericks now, better wait for a few more weeks till some update come up n fix those issues....

  • Batch Renaming Files

    Greetings,
    Is there a way to "Batch Rename" a group of files?
    For example, I might want to rename dog.gif, cat.gif,
    rat.gif, etc. to animal01.gif, animal02.gif, animal03.gif, etc.
    Thanks,
    folsombob

    folsombob wrote:
    > I don't have a problem batch renaming files outside of
    DW. If I do, though, I
    > will break all of the links and references.
    There is no way of batch renaming files and preserving links
    and references.
    However, you can rename one file at a time in the Files
    panel, and
    Dreamweaver will automatically update the links throughout
    the site.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Need Help - Problem: Cannot rename the file

    I hv three type of file, which is original file, processed file and edited file. Then, my goal is change all the three type of filename after i edit and save the document...
    My problem is sometime it can be changed, but sometime it just change either one or two type of filename only.....
    Can somebody to help me........10s first....
    Below is my coding.....
    String nfilename = tokenString[0] + "_edited";
    File original = new File(directoryname + "\\" + "original" + "\\" + tokenString[0] + ".txt");                     
    File noriginal = new File (directoryname + "\\" + "original" + "\\" + nfilename + ".txt");
    boolean success1 = original.renameTo(noriginal);
    File process = new File(directoryname + "\\" + "process" + "\\" + tokenString[0] + ".xml");                         
    File nprocess = new File (directoryname + "\\" + "process" + "\\" + nfilename + ".xml");
    boolean success2 = process.renameTo(nprocess);
    File edit = new File(directoryname + "\\" + "edit" + "\\" + tokenString[0] + ".xml");
    File nedit = new File(directoryname + "\\" + "edit" + "\\" + nfilename + ".xml");                     
    boolean success3 = edit.renameTo(nedit);

    I have some problem when I rename file that have filename in thai language.
    I think may be it's depend on locale, I changed locale to TH but it's not work yet.
    some body help me

  • What is the name of the process that renames File & Folders? To fix name entry problem?

    What mac linux process found in the Activity Monitor renames files and folders? My mac is slow under mac osx 10.7.5 and nearly unusable to name files and folders since as you name them it will jump the cursor and highlight causing the name I put in to disappear. I hate this so much I'm looking at a windows box! So what process can I raise priority of to help with this severe problem?

    aaron-
    Premiere Elements 12 on Windows 7 (assumed 64 bit)
    Have you updated 12 to the 12.1 Update using an opened project's Help Menu/Update? If not, please do so.
    If you are referring to that red stem with the blue head at the Timeline level in the Expert workspace, that is indeed the Timeline Indicator (also referred to as CTI).
    To be ruled in or out at the onset...whether or not you see an orange line over the Timeline content that you are attempting to preview?
    If you (manually) or the project (automatically) have set the correct project preset, there should be no colored line
    of the source video when it is first dragged to the Timeline. That is the program telling you that you are getting
    the best possible preview. If orange, you are not and need to "Render" the Timeline content to get the best possible preview.
    Does this "Timeline Rendering" factor apply to your situation?
    If you are getting the best possible preview, we still need to know the properties of your source media ---
    video compression
    audio compression
    frame size
    frame rate
    interlaced or progressive
    pixel aspect ratio
    Often the above can be gathered from knowing brand/model/settings for the camera that recorded the video.
    Also are you observing this behavior if you start a new project or use different source media, such as, stills or videos
    recorded with a different format?
    Let us start here and then decide what next.
    Thank you.
    ATR

  • Rename files or folders in Windows 8 not working

    Rename a file or folder on a Windows CE device is not working from Windows 8 when connected through Windows Mobile Device Center.
    From Windows 7 it worked just fine!
    This has been a problem for a very long time now, and im not alone according to all forums.
    But no fix as far as i can find!
    Is there anyone that have found a fix on this?

    http://answers.microsoft.com/en-us/windows/forum/windows8_1-files/windows-8-unable-to-rename-files-on-pocket-pc/abae21b7-7ee1-41c7-853e-1ac7ea5b0413
    It seems a issue in window 8.x system. Maybe you can ask for a MS support ticket. 

  • Sharepoint 2013 ItemAdded event receiver for renaming files is not working

    In SP 2013 I coded an event receiver that intercepts the ItemAdded event and it just renames the file.
    It is a synchronous event (I added <Synchronization>Synchronous</Synchronization> in the Elements.xml).
    This is the code:
            public override void ItemAdded(SPItemEventProperties properties)
                SPSecurity.RunWithElevatedPrivileges(delegate()
                    try
                        OutputDebugStringA("Inside ItemAdded");
                        string szHttpUrl = properties.WebUrl + "/" + properties.AfterUrl;
                        SPWeb openedWeb = properties.Web.Site.OpenWeb(properties.Web.ID);
                        SPFile spf = openedWeb.GetFile(szHttpUrl);
                        EventFiringEnabled = false;
                        string szUrl = properties.AfterUrl;
                        szUrl = szUrl + ".renamed";
                        string szNewFileName;
                        if (szUrl.LastIndexOf('\\') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('\\') + 1);
                        else if (szUrl.LastIndexOf('/') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('/') + 1);
                        else szNewFileName = szUrl;
                        if (properties.ListItem != null)
                            properties.ListItem["Title"] = szNewFileName;
                            properties.ListItem.Update();
                        spf.MoveTo(szUrl);
                        EventFiringEnabled = true;
                        base.ItemAdded(properties);
                        OutputDebugStringA("Renaming to " + szUrl);
                    catch (System.Exception exception)
                        OutputDebugStringA("ItemAdded ERROR: " + exception.ToString());
    The problem is that when I upload a .txt file using Internet Explorer, just after the renaming is done, IE says that something went wrong and when I inspect the log files I see:
    SPRequest.GetFileAndFolderProperties: UserPrincipalName=i:0).w|s-1-5-21-4050800873-4278272723-3073177257-500, AppPrincipalName= ,bstrUrl=http://sp2013/sites/demo/subsite1 ,bstrStartUrl=Shared Documents/test2.txt ,ListDocsFlags=16400 ,bThrowException=True 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    01/09/2014 15:29:26.75  w3wp.exe (0x1544)                        0x16F4 SharePoint Foundation        
     General                        ai1wu Medium   System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>,
    StackTrace:    at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)     at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean
    throwException)     at Microsoft.SharePoint.SPFile.get_Length()     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadPage.OnSubmit(Object o, EventArgs e)     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadExPage.OnSubmit(Object
    o, EventArgs e)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest(Boolean includeSta... 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    ...gesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest()     at System.Web.UI.Page.ProcessRequest(HttpContext context)     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)     at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)     at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext
    context, AsyncCallback cb)     at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr
    rootedObjectsPointer, IntPtr nativeRequestContex... 0fa7689c-674b-5045-c3a2-b214a5d4cbed
    ...t, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr
    pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr
    rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)     at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags) 
     0fa7689c-674b-5045-c3a2-b214a5d4cbed
    So it is clear that the fact that I renamed the file is causing an issue in the SharePoint upload logic.
    As a solution what I did was to not declare it as Synchronous, but if I do it then there is another error when Sharepoint shows the Edit Properties dialog... in this case the upload is OK but when it is time to show that Edit Property dialog IE fails and
    says that the file has been already modified, or that "something went wrong".
    If I use a synchronous event I get one problem. If I use the asynchronous event I get another problem... It's very frustating and I am pretty sure that a so important API like Event Receivers should have support renaming files so I hope someone can tell
    me what I am doing wrong.
    Thanks in advance

    May be you want to consider using the following code and see if it works for you.
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/40c78e03-2dca-4083-89d2-a7430099da68/how-do-i-change-the-name-property-of-a-file-in-a-document-library?forum=sharepointdevelopment
    Amit

  • Deleting & renaming files - is there a shortcut to finder?

    I am a recent convert from PC to Mac. So far so good. However, one thing starts to drive me up the wall which is deleting/renaming files in programs such as photoshop, word, excel etc.etc.
    As far as I can tell, this is only possible in the finder menu. Is this Correct? I am using a lot of folders and subfolders - sometimes 3-4 levels deep. Every time I need to change/delete a file or filename - lets say while in photoshop, I have to go to finder and click my way through several levels of folders to the actual file I need to change. This is somewhat annoying and timeconsuming.
    Question 1: is there a way to do these operations in - lets say photoshop directly?
    Question 2: If not, is there a shortcut key that would point me automatically to the file in finder where I can make the changes?
    Your input would be very helpful and save me some aggravation.
    fupe

    Hi Greg,
    Thanks for your input. You are correct as far as "save" and "save as" is concerned. Windows and Mac work the same way.
    However, as far as I can tell, in Mac you can only "delete" or "rename" a file in "finder" which forces you to open up finder and locate the file in order to delete or change it.
    In windows you can do these 2 functions directly in the program (such as photoshop, excel or words). You do not have to go to "explorer or root directory" to make these changes which I believe would be the equivalent of "finder".
    In any case, Terence solved the problem. By command clicking the name (title) of the file in any program, it opens up the directory in "finder". This way makes it easy to select the file and do the changes.
    fupe

  • Can't delete, rename files, or move to another folder

    I had posted earlier about not being able to delete, rename files, or move to another folder. It never was resolved here, and I guess Apple still hasn't done anything about it. Here's a great workaround I found though in case others need something. Download the program called "Unlocker", it's free and you can get it at http://ccollomb.free.fr/unlocker/ When you get the message about the file being in use, even though QuickTime isn't even open, you can unlock the f'ing file and do whatever you want to then, move, uh DELETE, or rename, or whatever. Try it, it's the best thing going so far seeing Apple isn't doing anything about this problem.

    Hi there,
    I am still struggling with this problem. Actually my coworker has the same machine, Apple pro with windows xp installed, but he does not have this problem with his quicktime 7.5. I uninstalled 7.5 and installed 7.2, but it did not solve the problem. The fact is that I don't have the problem in my laptop which I am using it in the office. I am still trouble shooting. Hopefully I can find an answer.
    Peace

  • Automator: Impossible to rename file using automator under Mac OS X Lion

    Hi,
    Before upgrade my iMac to MAC OS X Lion 10.7.2, I had service created with automator under snow leopard in order to rename my pictures file names by blocks instead of one by one. Since I'm using Lion, this one doesn't work anymore. I have completely recreate the service under Lion and the results is the same.
    You can find below my workflow that is easy. The problem is the message error in the history of automator application. The message is "impossible to rename file "file name" because this one should create conflict with existing file". I already test a lot of times with different name where I'm sure that this one doesn't exist on my Mac but all the time without success (verify also with search function under mac)
    If somebody can help me, it would be very interesting because I already tried to find answer on internet without success too.
    Thanks in advance for your help.

    the whole automator and in particular the record action was substantially rewritten in snow leopard. and the record action is slow, unreliable and you can't trouble-shoot it. it's a wonder it works at all. the only advice i can give is to use it as little as possible. if at all possible avoid it altogether. if you do need to use it try using keyboard strokes instead of the mouse movement. for example. use command+c and command+v for copying and pasting and use tabbing to choose the correct box on the page.

  • Renaming files with invalid characters in their names on NTFS partitions, introduced by operating systems other than Windows

    Essentially, Linux created some files with colons (:) in the name on a NTFS partition where I have Windows installed. I have since uninstalled Linux, but now I can only view these files in Windows Explorer. I can't open them, I can't even rename them to
    correct the problem. It's as if they don't exist, because of the invalid search paths.
    If I try to rename them in Windows Explorer I get following message.
    The file name you specified is no valid or too long.
    Specify a different file name.
    Well isnt' that something?... isn't that nice? Windows is able to display these files, but it doesn't allow me to open them and it certainly doesn't like me to rename them. So why is it whining about it then, when I'm trying to help? It says "try a different
    file name". Yeah, right! Like I haven't tried that one already! It doesn't matter what file name I input it will never accept it.
    So what am I supposed to do now? Ditch Windows and go back to Linux? Surely, Microsoft doesn't like the sound of that. Sure, I could reinstall Linux or run a Linux live system to correct the problem. But what good is Windows then? I might as well switch to
    Linux altogether.
    After doing some research I now know by fact that it's (kind of) possible to rename files from UNIX and UNIX-like operating systems to those compliant with Windows by using something called file name character translation. To some level this is essential and
    necessary for Windows interoperability with other operating systems (Windows is not the only operating system in the world). But this seems to be very complicated and I can't get my head around it. My brain is in overload. I don't know where to start.
    Once there was a...
    There's the Windows Services for UNIX (SFU) 1.0, 2.0, 3.0, 3.5. The first two versions were based on MKS Toolkit, a package licensed by Microsoft from MKS Inc. The later versions were based on the similar Interix product, after Microsoft purchased the company
    that made it.
    Then there's the new Subsystem for UNIX-based Applications (SUA). These are services for UNIX components. They are supposed to have Client for NFS v3 included as well. But the server components from the SFU line is missing (e.g. Server for NFS). These are included
    in Server editions of Windows.
    Then there's the Microsoft Knowledge Base article
    289627: "How to Enable File Name Character Translation". This article seems to describe exactly my situation.
    Windows and UNIX operating systems have restrictions on valid characters that can be used in a file name. The list of illegal characters for each operating system, however, is different. For example, a UNIX file name can use a colon (:), but a Windows
    file name cannot use a colon (:). If a UNIX user attempts to create a file with a Windows illegal character on a Windows Services for UNIX network file system (NFS) share, the attempt is unsuccessful and the UNIX client computer receives an input or output
    error.
    It goes further than that. At first glance, this KB article also seems to offer a solution to this exact problem, with examples as shown below.
    For example, the following maps the UNIX colon (:) to a Windows dash (-):
    0x3a : 0x2d ; replace client : with - on server
    I checked these values in charmap.exe and they are correct. Except for 2D not being a "dash", it's rather a hyphen ("hyphen minus" to be exact), but these two have pretty much the same appearance and they get interchanged a lot, I'm sure
    they are used to it by now. (Yes, the characters! They don't mind.)
    Then there's this registry key.
    HKEY_LOCAL_MACHINE\Software\Microsoft\Server For NFS\CurrentVersion\Mapping
    Well, of course, I don't have Server for NFS. So this is a dead end. Well, actually, it was a dead end from the beginning...
    1. First of all, I'm not working with a network share on a NAS or SAN storage. The files are on the local disk drive where Windows is installed, so that's a DAS for you.
    2. I don't have SFU! Well obviously, I'm on Windows Vista! So that means SUA!
    3. SUA are service components only. No server components. Can you guess what that means? Yeah... no "Server for NFS" since it's a server component.
    4. Windows Vista is a client side operating system! Server for NFS is only offered for use with Windows Server systems.
    5. Back to square one!
    So there you have it. They all lived happy for the rest of their lives...
    I'm stuck here. Can someone tell me what to do? I mean beyond the obvious option to use Linux to fixa a Windows problem? The NTFS file system itself supports colons in file names. It's Windows that doesn't, and so by default it proclaims it invalid character.
    Surely, even a Windows client operating system like Windows Vista should be able to allow the user to at least rename files with invalid characters to something more sensible (from the system point of view) and valid, if not being able to open them as they
    are. Just add some crazy voodoo code to it and it will work. If you can make it possible on Windows Server with UNIX user-mode subsystem on NT kernel, then what's stopping you from giving the Windows client system the same benefit?
    So what now? Purchase a Windows Server 2012 R2 license, copy my invalid files to a NAS share with NFS on a UNIX or Linux system, and have a go at the Windows registry and Server for NFS? Yeah... you're right, it's probably a bit over the top...
    On a second thought... I might as well install Linux again. There are countless situations where Linux has helped me solve problems related to, and more often than not caused by Windows.

    Essentially, Linux created some files with colons (:) in the name on a NTFS partition where I have Windows installed. I have since uninstalled Linux, but now I can only view these files in Windows Explorer. I can't open them, I can't even rename them to
    correct the problem. It's as if they don't exist, because of the invalid search paths.
    If I try to rename them in Windows Explorer I get following message.
    The file name you specified is no valid or too long.
    Specify a different file name.
    Well isnt' that something?... isn't that nice? Windows is able to display these files, but it doesn't allow me to open them and it certainly doesn't like me to rename them. So why is it whining about it then, when I'm trying to help? It says "try a different
    file name". Yeah, right! Like I haven't tried that one already! It doesn't matter what file name I input it will never accept it.
    So what am I supposed to do now? Ditch Windows and go back to Linux? Surely, Microsoft doesn't like the sound of that. Sure, I could reinstall Linux or run a Linux live system to correct the problem. But what good is Windows then? I might as well switch to
    Linux altogether.
    After doing some research I now know by fact that it's (kind of) possible to rename files from UNIX and UNIX-like operating systems to those compliant with Windows by using something called file name character translation. To some level this is essential and
    necessary for Windows interoperability with other operating systems (Windows is not the only operating system in the world). But this seems to be very complicated and I can't get my head around it. My brain is in overload. I don't know where to start.
    Once there was a...
    There's the Windows Services for UNIX (SFU) 1.0, 2.0, 3.0, 3.5. The first two versions were based on MKS Toolkit, a package licensed by Microsoft from MKS Inc. The later versions were based on the similar Interix product, after Microsoft purchased the company
    that made it.
    Then there's the new Subsystem for UNIX-based Applications (SUA). These are services for UNIX components. They are supposed to have Client for NFS v3 included as well. But the server components from the SFU line is missing (e.g. Server for NFS). These are included
    in Server editions of Windows.
    Then there's the Microsoft Knowledge Base article
    289627: "How to Enable File Name Character Translation". This article seems to describe exactly my situation.
    Windows and UNIX operating systems have restrictions on valid characters that can be used in a file name. The list of illegal characters for each operating system, however, is different. For example, a UNIX file name can use a colon (:), but a Windows
    file name cannot use a colon (:). If a UNIX user attempts to create a file with a Windows illegal character on a Windows Services for UNIX network file system (NFS) share, the attempt is unsuccessful and the UNIX client computer receives an input or output
    error.
    It goes further than that. At first glance, this KB article also seems to offer a solution to this exact problem, with examples as shown below.
    For example, the following maps the UNIX colon (:) to a Windows dash (-):
    0x3a : 0x2d ; replace client : with - on server
    I checked these values in charmap.exe and they are correct. Except for 2D not being a "dash", it's rather a hyphen ("hyphen minus" to be exact), but these two have pretty much the same appearance and they get interchanged a lot, I'm sure
    they are used to it by now. (Yes, the characters! They don't mind.)
    Then there's this registry key.
    HKEY_LOCAL_MACHINE\Software\Microsoft\Server For NFS\CurrentVersion\Mapping
    Well, of course, I don't have Server for NFS. So this is a dead end. Well, actually, it was a dead end from the beginning...
    1. First of all, I'm not working with a network share on a NAS or SAN storage. The files are on the local disk drive where Windows is installed, so that's a DAS for you.
    2. I don't have SFU! Well obviously, I'm on Windows Vista! So that means SUA!
    3. SUA are service components only. No server components. Can you guess what that means? Yeah... no "Server for NFS" since it's a server component.
    4. Windows Vista is a client side operating system! Server for NFS is only offered for use with Windows Server systems.
    5. Back to square one!
    So there you have it. They all lived happy for the rest of their lives...
    I'm stuck here. Can someone tell me what to do? I mean beyond the obvious option to use Linux to fixa a Windows problem? The NTFS file system itself supports colons in file names. It's Windows that doesn't, and so by default it proclaims it invalid character.
    Surely, even a Windows client operating system like Windows Vista should be able to allow the user to at least rename files with invalid characters to something more sensible (from the system point of view) and valid, if not being able to open them as they
    are. Just add some crazy voodoo code to it and it will work. If you can make it possible on Windows Server with UNIX user-mode subsystem on NT kernel, then what's stopping you from giving the Windows client system the same benefit?
    So what now? Purchase a Windows Server 2012 R2 license, copy my invalid files to a NAS share with NFS on a UNIX or Linux system, and have a go at the Windows registry and Server for NFS? Yeah... you're right, it's probably a bit over the top...
    On a second thought... I might as well install Linux again. There are countless situations where Linux has helped me solve problems related to, and more often than not caused by Windows.

Maybe you are looking for

  • My ipod is restarting again and again with a crack like sound

    I have a iPod Classic. Few days ago i was listening music and i noticed that the power suddenly reaches to half. After few second it was just about to empty. And after few second my iPod turned off and restarted again but not completely. When ever it

  • Using DAO for reports or lists?

    Kind of a dumb question, but I'm trying to improve (read that start) the MVC isolation in a web application using JSP. I have created DAO's for the common business objects, but when it comes to reporting, what's the best way to do this? For example,

  • Column Alias Logic!

    Hi, I'm in the process of learning Oracle9i SQL and I don't understand why column alias are not allowed in a where and group by clause but are allowed in the order by clause? To me this makes no sense and I have noticed that that there are a lot of c

  • [OT] Fundamentos del diseño

    Hola a todos Hace algunos años que estoy diseñando y me doy cuenta de que necesito aprender bien los principios básicos del diseño gráfico. Me refiero a la teoría del diseño, es decir la composición, el color, la tipografía ... ¿Alguien sabe alguna w

  • My iPhone just loaded 1600  emails dating back over two years from one of my accounts. Is there a way to "mark all as read"?

    My iPhone just loaded 1600  emails dating back over two years from one of my accounts. Is there a way to "mark all as read"?