Script to Batch Fix Broken Aliases?

I just recently migrated from an old PowerBook G4 to a new MacBook Pro and all went smoothly. Except, now in a folder that contains hundreds of aliases of various text files, all of the aliases are broken.
The original files are still present in their proper locations and I can fix each alias one at a time. Examining the properties of the broken aliases reveals that the paths to the original files seem to reflect where those files were located the first time I saved them. For instance, on the PowerBook, I saved some info from Safari into a text file and saved the file on my desktop. I put an alias of the file into a "Research Folder," then dragged the original into a "Clippings" folder. Well, now on the MBP with the migrated files, the alias thinks the original file is back on the desktop (and thus, the alias is broken). It's as though in the migration, the new MBP somehow got an old index or something.
In any case, the bottom line is that I can't accept the notion of going through and manually fixing each of the hundreds of aliases one at a time.
Fixing the aliases is pretty simple logic. The filenames are the same. It's basically search the home directory for a file with a matching name and type and make the new association.
Does anyone know of a script or applet that might be able to do this? Maybe there's another mass fix I'm not thinking of?
Any help would be greatly appreciated.
Update: For the record, I did fix permissions and run a disk repair after the migration.

To remotely rename folders you must use an admin account on the remote system. The folder must not be protected the system and you cannot us WMI to rename the folder.
You may have to restart the system after setting WMI to manual start as it can have locks and it may not shutdown cleanly.
¯\_(ツ)_/¯

Similar Messages

  • Powershell script to help fix broken WMI on remote servers/computer.

    I have a number of servers/computers that I am not able to update due to broken WMI. Does anyone out there have a Powershell script that will stop the WMI service, rename the repository and logs folders, then restart the WMI service again?
    I created a script to stop the service, but it will not allow me to rename the folders (tells me access denied). If I dameware into the pc and log in with my admin credentials I have no issues manually doing the above steps, but there has to be an easier
    way!
    Any help would be greatly appreciated.

    To remotely rename folders you must use an admin account on the remote system. The folder must not be protected the system and you cannot us WMI to rename the folder.
    You may have to restart the system after setting WMI to manual start as it can have locks and it may not shutdown cleanly.
    ¯\_(ツ)_/¯

  • Broken aliases in mountain lion

    I'm using 10.8.1 on a 15-inch MBP. Recently, I've been getting several repeatedly broken Aliases of folder on my desktop. My process is to create the folders on my local HD and then use the Finder option by right-clicking to Create Alias. I then move the Alias folder to the desktop and delete the word Alias. This has worked for me for years, but suddenly it's problematic on recently created folders. Even after I've "Fixed Alias". Has anyone had this experience?

    This is a bit late this. I had similar problems, looked for an answer, and couldn't find one.
    So I wrote a script that will do it as follows:
    Given an alias directory, and a "target files" directory:
    - Test files names for a trailing "alias" and test files to see if they are symbolic links.
    - If so, search for filenames in the target directory tree matching the root of the alias or link name
    - If found: replace the broken alias or link with a new symbolic link.
    That works for me but it's not a very nice solution:
    1) It doesn't use a good test for aliases, which is slightly dangerous but not very: It'll fail in the unlikely case a files which is not an alias finishes with " alias", or if an alias has had the trailing " alias" removed.
    2) It doesn't check for multiple file matches, and will link to the first it finds. (or link to all of them in turn, over-writing, I can't remember).
    3) most importantly: It removes all aliases and replaces them with symbolic links which isn't great. Aliases supposedly have greater flexibility than links which explains why they are ten times the size.
    Links are enough for me - I'm just posting this as an indication of what can be done, without including my inelegant script.
    Finally, a good place to look to learn how to do a better job is this person I came across:
    http://sveinbjorn.org/osxutils_docs
    This Sveinbjorn has shared this utility "mkalias" which shows how to make aliases.
    From there, it's probably not hard to make a proper applescript "alias" test in place of my stupid filenamename method, and test separately for aliases and links to avoid the "all links" problem.
    And finally a little test for multiple matches when searching for the target would be nice.
    Good luck.
    I myself will probably stick to links, too lazy.

  • Shell script for batch compilation of forms 10g on AIX 5.3L AS

    Hi All,
    Can anybody provide me the Shell script for batch compilation of forms 10g and reports 10g on AIX 5.3L AS?
    Regards,
    SAM

    Hi Alex,
    I tried with the below script as well as the one you had posted.
    ORACLE_HOME=/opt/oracle/OraHome_3
    export ORACLE_HOME
    TNS_ADMIN=$ORACLE_HOME/network/admin
    export TNS_ADMIN
    LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/jdk/jre/bin:$ORACLE_HOME/jdk/jre/bin/cla
    ssic:$LIBPATH
    export LIBPATH
    cd ../forms
    for i in `ls *.pll`
    do
    echo Compiling Library $i ....
    $ORACLE_HOME/bin/frmcmp module=$i userid=mydbuser/mydbuser@mydb
    batch=yes module_type=library
    compile_all=yes window_state=minimize
    done
    export ORACLE_HOME=/opt/oracle/OraHome_3
    export ORACLE_TERM=vt220
    export LD_LIBRARY_PATH=/opt/oracle/OraHome_3/lib:/opt/oracle/OraHome_3/jdk/jre/l
    ib:/opt/oracle/OraHome_3/jdk/jre/lib/i386:
    cd ../forms
    for i in `ls *.pll`
    do
    echo "Compiling Library $i ...."
    /opt/oracle/OraHome_3/bin/frmcmp module_type=form userid=mydbuser/mydbuser@mydb
    module=$i batch=yes compile_all=no
    window_state=minimize upgrade=no
    done
    echo "PLL Compilation done"
    But there was a same kind of error thst turning up all the time.
    Compiling Library Agf.pll ....
    Forms 10.1 (Form Compiler) Version 10.1.2.0.2 (Production)
    Forms 10.1 (Form Compiler): Release - Production
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    PL/SQL Version 10.1.0.4.2 (Production)
    Oracle Procedure Builder V10.1.2.0.2 - Production
    Oracle Virtual Graphics System Version 10.1.2.0.0 (Production)
    Oracle Multimedia Version 10.1.2.0.2 (Production)
    Oracle Tools Integration Version 10.1.2.0.2 (Production)
    Oracle Tools Common Area Version 10.1.2.0.2
    Oracle CORE 10.1.0.4.0 Production
    FRM-10043: Cannot open file.
    Form not created
    I hence updated the permissions on the pll as below
    -rwxrwxrwx 1 oracle oinstall 335872 May 19 16:31 Agf.pll
    But the problem is still persisting.
    My environment details are as below.
    I am working on Win XP machine. Connected to my AS via telnet and xmanager. I have set my DISPLAY to my local IP.
    Is there any thing more that I need to do? If so then let me know.
    Regards,
    SAM

  • How do I find broken aliases

    I relocated some of the files on my iMac, not I don't know if such move has invalidated any existing aliases. I want to find all the broken aliases.
    I looked into Spotlight. It does not seem to have an option to do so.
    I opened the command window and tried to use the good old UNIX "find" command.
    find -L . -type l -print
    Only the good linked files are shown. All the broken alias (i.e. the alias points to a non-existing file because it moved or deleted) were not shown. I used one of the known broken alias to test if the search was effective. The answer is no. The broken alias is displayed as a zero size file. The UNIX "ls -l" command does not even show the "l" indicator in the permission code. A valid alias is shown with the "l".
    Please tell me if you know any trick to find all the broken aliases.
    Thanks in advance.

    Thanks for the information. For some reason, my file system still have a few invalid aliases. They may or may not be caused by the file move. They may be caused by changes in my external drive. Perhaps something was changed off-line or while I was in another login account. Apparently if User1 and user2 both have an alias on a file and when user1 move that file, user2 alias will not be updated. It may not have happened like that, but it appears to.
    Other than buying a software for the task. Is there anyway to find broken aliases using out-of-the-box Apple software tools?

  • Action script though batch client

    While importing data using Action Script, if we have properties with same label name which belongs to different namespaces, DRM is not able to identify which property it should actually point to. Generally when we run the script from UI, we manually select the correct property in UI.
    Now, what can be done to achieve the same functionality when we run the script from batch client.
    Suppose we have two properties, with same label name as ACCOUNTCODE which are present in two different namespaces,
    ESSBASE.ACCOUNTCODE
    CUSTOM.ACCOUNTCODE
    Now while importing the action script, system is unable to determine to which ACCOUNTCODE property it should point. What changes in action script or any other places  can be done to make the system enable to point to the correct property.

    Our client wants it this way only (having same property labels across Namespaces). Is this possible to have Property Names or Fully qualified Property Names instead of Labels in hierarchy export of DRM?

  • [svn:fx-trunk] 10866: Fix broken links in ASDoc comments for TLFTextInput. as and TextArea.as, and add OverrideBase.as to ASDoc output

    Revision: 10866
    Author:   [email protected]
    Date:     2009-10-05 08:56:44 -0700 (Mon, 05 Oct 2009)
    Log Message:
    Fix broken links in ASDoc comments for TLFTextInput.as and TextArea.as, and add OverrideBase.as to ASDoc output
    QE notes: -
    Doc notes: -
    Bugs: -
    Reviewer: -
    Tests run: - checkintests
    Is noteworthy for integration: No
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/states/OverrideBase.as
        flex/sdk/trunk/frameworks/projects/spark/src/mx/controls/TLFTextInput.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as

    Sorry about that. I am not exactly sure where the problem is, but I know it takes place after I put the <nav> in (in the html portion). If I understand what I am learning, the CSS at the top will structure my html code so I would have thought the CSS tageting my nav would be the focus. Maybe it is a different section though.
    CSS part:
    nav p {
    font-size: 90%;
    color: #FFC;
    text-align: right;
    font-weight: bold;
    background-color: #090;
    padding-top: 5px;
    padding-right: 20px;
    padding-bottom: 5px;
    border-top-width: 2px;
    border-top-style: solid;
    border-top-color: #060;
    HTML part: (bold italic is the part I added)
    <body>
    <div class="container">
      <div id="apDiv1"><img src="Lessons/images/butterfly-ovr.png" width="170" height="158" alt="GreenStart Logo"></div>
      <header></header>
      <nav>
        <p>Home | About Us | Contact Us</p>
      </nav>
      <div class="sidebar1">
        <ul class="nav">
          <li><a href="#">Green News</a></li>
          <li><a href="#">Green Products</a></li>
          <li><a href="#">Green Events</a></li>
          <li><a href="#">Green Travel</a></li>
          <li><a href="#">Green Tips</a></li>
        </ul>

  • Script for batch processing

    Hello
    I need help
    I created a batch sequence which set watermark and security to pdf files from one directory. Now i want to create another sequence: 1. set security to none and 2. delete watermark.
    I have a problem with set security to none because every time i need change preferences for batch process to security method=password security by hand.
    Maybe there is a way to change this settings with java script in batch "execute java script"?
    Or how i can change with batch sequence a security method from passsword security to "none" if i know password
    Thanks in advance

    Create a "blank" batch process (ie, without any action), but under the Output Options tick the box to optimize the files and set the optimization settings you want to use.

  • RH8 fixing broken links

    In RH8, I'm trying to fix broken links. I find the topics, then they move from the Broken Links folder to the correct folder but then the topic still looks like it has a broken link! Can anyone advise? here's a pic

    Hello again
    Unfortunately you are totally misunderstanding things. Please allow me to try and explain better.
    ANY folder in your project is going to have an FPJ file inside it. This is a "behind the scenes" file that RoboHelp uses to keep track of the files that are part of the project.
    In the image you provided, there are two folders in the project location with similar names:
    Ranger_Help
    Ranger_Help_
    Only the Ranger_Help_ appears to actually be part of the project because the other folder Ranger_Help isn't appearing in the image capture showing the project inside RoboHelp. So unless something screwy happened, you should not find an FPJ file inside that folder. Then again, you may find one. It all depends on what happened.
    Personally, I'd look inside the Ranger_Help folder and see if the files representing the broken links are inside. They may well be. And if so, I'd copy them to the Ranger_Help_ folder and see if that resolves things.
    This project is beginning to resemble a bowl of spaghetti!
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Creating script in Batch Processing

    I am having issues creating a script in batch processing for any user, including the admin. The error is "Permission Denied - 70". I've rebooted servers, checked shared/NTFS permissions on the folder locations for the application. This is FDM 11.1.1.1, SS and HFM are 11.1.1.2.
    Not finding anything as of yet, and we really need this to work.
    Any help would be great!
    Thanks,
    --Ed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Ed,
    This has to do with OS permissions ... not permissions inside the application.
    Please make sure that the user you are running the software as has full control of the NTFS FileShare.
    Thank you,

  • How to execute SQL scripts in batch

    Hi,
    I have separate scripts for Creation of Tables, Stored Procedures, Views, Triggers in different .sql files.
    I have to execute thses scripts in batch in different servers and different databases without opening SSMS.
    All .sql files to be executed in single command.
    Please suggest how to achieve?
    Appreciate your help.
    Regards,
    Bala

    you can use sqlcmd
    https://msdn.microsoft.com/en-us/library/ms162773.aspx
    other options are osql,isql
    https://technet.microsoft.com/en-us/library/aa214012%28v=sql.80%29.aspx
    https://technet.microsoft.com/en-us/library/aa214007%28v=sql.80%29.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • A suggestion to fix broken screens

    About two years ago, my iMac and the table it was sitting on had a collision, due to brakes being applied strongly in our motorhome. The result was a ugly crack in the screen and a jagged pattern of black on the screen.
    I have no idea what possessed me to think "Bandaid", but I immediately put clear 2 inch wide packing tape over the break, and the crack radiating from same. To my amazement, the black area didn't grow any more, and over a period of time, the black WENT AWAY. It had healed itself.
    A year later, that same abused iMac took another spill during a move which seemed to "reopen" the wounds. Now, thirteen months later, those black marks are gone. Again.
    So if you have suffered non-catastrophic screen fractures, they might be repaired. Give it a try.

    Hello Richard,
    Blimey! Packing tape really can fix broken things? Including computer screens! I is very impressed I is.
    Regards.
    Ian.

  • [svn:fx-trunk] 8708: Fix broken build

    Revision: 8708
    Author:   [email protected]
    Date:     2009-07-21 07:46:45 -0700 (Tue, 21 Jul 2009)
    Log Message:
    Fix broken build
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/textLayout/build.xml

    Welcome back everyone.
    Hope you all had good holidays.
    Cheers
    glenn
    tinylion development & design

  • Enhancement for Production Order Release and Batch Fixing.

    Hi Experts,
    I have assigned a enhancement for production order.The user exit is also given in the req as PPCO0001 through which i have to call a Z-Program for Batch fixing using Trans CO01 and release the order before saving once it is assigned to components.
    Now my probs is where to start working for the enhancement -is it possible to use any BAPI instead of Batch (BDC) or I can use any BADI instead User Exit.
    So if you guys have similar scenario worked on it or have similar example approach to solve it.Please do help.I will reward for all helpful answers.

    I figured out thr friends !
    Thanks,
    SriRam

  • [svn:fx-3.x] 7545: Fix broken ASDoc comment

    Revision: 7545
    Author:   [email protected]
    Date:     2009-06-04 04:55:39 -0700 (Thu, 04 Jun 2009)
    Log Message:
    Fix broken ASDoc comment
    QE Notes: None
    Doc Notes: None
    Bugs: -
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as

Maybe you are looking for

  • Reg. Posting period 001 2008 is not open

    Dear All Kindly reply for the below error: When I try to GRN in my Ides system the following error occured.I cann't solve. I checked in OB52,OMSY,OB37,OB29.But I cann't solve this problem. Please help me "Posting period 001 2008 is not open" Thanks R

  • Change LOV of column in view, based on values of another LOV of column in the same view

    Hi, I am using Jdeveloper 11.1.1.5. I have a scenario in which I have two columns in the view. column names are: 1- Column A 2- Column B                     both the columns have LOV's LOV in column A contains values as: 1, 2. Now, when I select the

  • Map Profit Center as custom field to product

    Hi, We want to map Profit Center(35 characters) to a custom field in product for some analysis. We want to map it to Custom Attribute 2 (XARLPROA2) this is a 40 character long field. We do not want to see this field in Reports in UI. Please let us kn

  • Trimming a string using spaces as a delimitter

    I'm trying to retreive email addresses from individual message bodies. I'm using the following code and it is working well : <cfset addrpos = ListContainsNoCase(getmail.body, "@", " <> ")>      <cfif addrpos neq 0>      <cfset email = ListGetAt(getma

  • Abap with MM

    Hi friends, I have just started working on ABAP ,Please help me know about the temrs realted to MM, What is document type ? What is the important features of document type? What is pricing Procedure ? What is Release Strategy i also want to know whth