Moving Folders base on their names using powershell

Hi there, I've reading some examples here which are not exactly what I need so I've been trying to adapt them with no luck. Sorry not a programmer here, but I need this done and don't know where to go.
The point is that I have 42.000 folders in a folders.
All the folders' names are numbers from 4 to 7 digits (which represents clients ID's)
They should be separated based on one list that I can put in a csv file.
In words my script should do this:
working path= d:\a (this is where the 42K folders are)
moving path= d:\a\movedfolders
list of folder to be moved= listtomove.csv
command:
read listtomove.csv
from beginning to end of listtomove.csv
compare first in list to all folders and
  if find a match then move to movedfoders
  if not read next value at listtomove.csv
next
exit:
voila... you just moved 22000 folders to the right place... lol (I don't need the count.)
Is this possible? if so: how?
Thanks for any help.

The script request page is here:
http://gallery.technet.microsoft.com/scriptcenter/site/requests
You can also look in the
repository for pre-written scripts.
This forum is designed to answer scripting questions, not to design and write scripts on demand.
-- Bill Stewart [Bill_Stewart]

Similar Messages

  • Add YYYYMMDD_xyz_ftp in front of the file name using PowerShell

    Hi All,
    I am working on a PowerShell script to generate a dat file. I need to change the format of this file as follows:
    Original File Name: eagle.dat
    Required File Name: YYYYMMDD_CA_eagle.dat
    I know that we can do this very easily from Windows Cmd like below. I have written this massive PowerShell script which I do not want to be wasted just because of this last step.
    rename eagle.dat %date:~-4,4%%date:~-10,2%%date:~-7,2%_CA_eagle.dat
    Thank you in advance for your reply.
    Ben

    Hi Ben,
    Give this a try:
    Rename-Item -Path .\eagle.dat -NewName ("{0:yyyMMdd}_CA_eagle.dat" -f (Get-Date))
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How can I define a name in Excel using Powershell?

    I know how to reference existing names using the RANGE function but how can I create a new defined name using Powershell?
    My specific case involves defining a name for a single cell with a workbook scope.  Just as if you were to right-click a cell in Excel and choose Define Name.
    The closest I've gotten is the NAMES object for the workbook but when I "gm" that all I see is a method for delete - nothing for adding.
    $xlsx = "c:\Sample.xlsx"
    $excel = new-object -comobject Excel.Application
    $xlb = $excel.Workbooks.Open($xlsx)
    $xlb.names | gm

    In Excel a Range has a name.  You can create a range and name it.  "Names" is just a list of the names that have been defined.
    So what is it that you are asking?  If your spreadsheet has names this will find them for you.
    Try this:
    $xlb.names|select name
    $r=$xlb.sheets.item(1).UsedRange
    $r.Name='all'
    # now do this again
    $xlb.names|select name
    So now you know everything about "names" or, as us old pros say "named ranges" like in the old  west.
    ¯\_(ツ)_/¯

  • How to list all USB AUDIO DEVICES using PowerShell on Windows 7

    Hi all, 
    I'm starting today on the powershell programming world, and my first task is list all USB Headsets plugged on my computer, I wanna get the name of this devices like is shown on Windows Volume Control.
    My headset is a ZOX  DH-60, every time that I change the USB port, the name changes, like Headset ZOX DH-60, then Headset 2 ZOX DH-60, how could I get this name using powershell ? 
    Thanks,
    Best Regards
    Leonardo Lima

    Hi, 
    Nope... see my command and return
    Get-WmiObject Win32_PnPEntity | ? {$_.Service -eq 'usbaudio'} | Select * | Format-List
    __GENUS : 2
    __CLASS : Win32_PnPEntity
    __SUPERCLASS : CIM_LogicalDevice
    __DYNASTY : CIM_ManagedSystemElement
    __RELPATH : Win32_PnPEntity.DeviceID="USB\\VID_0D8C&PID_000E&MI_00\\8&149B33FB&0&0000"
    __PROPERTY_COUNT : 24
    __DERIVATION : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
    __SERVER : HOBBIT
    __NAMESPACE : root\cimv2
    __PATH : \\HOBBIT\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_0D8C&PID_000E&MI_00\\8&149B33FB&0&0000"
    Availability :
    Caption : Generic USB Audio Device
    ClassGuid : {4d36e96c-e325-11ce-bfc1-08002be10318}
    CompatibleID : {USB\Class_01&SubClass_01&Prot_00, USB\Class_01&SubClass_01, USB\Class_01}
    ConfigManagerErrorCode : 0
    ConfigManagerUserConfig : False
    CreationClassName : Win32_PnPEntity
    Description : Dispositivo de áudio USB
    DeviceID : USB\VID_0D8C&PID_000E&MI_00\8&149B33FB&0&0000
    ErrorCleared :
    ErrorDescription :
    HardwareID : {USB\VID_0D8C&PID_000E&REV_0100&MI_00, USB\VID_0D8C&PID_000E&MI_00}
    InstallDate :
    LastErrorCode :
    Manufacturer : (Áudio USB genérico)
    Name : Generic USB Audio Device
    PNPDeviceID : USB\VID_0D8C&PID_000E&MI_00\8&149B33FB&0&0000
    PowerManagementCapabilities :
    PowerManagementSupported :
    Service : usbaudio
    Status : OK
    StatusInfo :
    SystemCreationClassName : Win32_ComputerSystem
    SystemName : HOBBIT
    Scope : System.Management.ManagementScope
    Path : \\HOBBIT\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_0D8C&PID_000E&MI_00\\8&149B33FB&0&0000"
    Options : System.Management.ObjectGetOptions
    ClassPath : \\HOBBIT\root\cimv2:Win32_PnPEntity
    Properties : {Availability, Caption, ClassGuid, CompatibleID...}
    SystemProperties : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
    Qualifiers : {dynamic, Locale, provider, UUID}
    Site :
    Container :
    __GENUS : 2
    __CLASS : Win32_PnPEntity
    __SUPERCLASS : CIM_LogicalDevice
    __DYNASTY : CIM_ManagedSystemElement
    __RELPATH : Win32_PnPEntity.DeviceID="USB\\VID_074D&PID_3556&MI_00\\8&285F78A6&0&0000"
    __PROPERTY_COUNT : 24
    __DERIVATION : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
    __SERVER : HOBBIT
    __NAMESPACE : root\cimv2
    __PATH : \\HOBBIT\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_074D&PID_3556&MI_00\\8&285F78A6&0&0000"
    Availability :
    Caption : ZOX DH-60
    ClassGuid : {4d36e96c-e325-11ce-bfc1-08002be10318}
    CompatibleID : {USB\Class_01&SubClass_01&Prot_00, USB\Class_01&SubClass_01, USB\Class_01}
    ConfigManagerErrorCode : 0
    ConfigManagerUserConfig : False
    CreationClassName : Win32_PnPEntity
    Description : Dispositivo de áudio USB
    DeviceID : USB\VID_074D&PID_3556&MI_00\8&285F78A6&0&0000
    ErrorCleared :
    ErrorDescription :
    HardwareID : {USB\VID_074D&PID_3556&REV_0006&MI_00, USB\VID_074D&PID_3556&MI_00}
    InstallDate :
    LastErrorCode :
    Manufacturer : (Áudio USB genérico)
    Name : ZOX DH-60
    PNPDeviceID : USB\VID_074D&PID_3556&MI_00\8&285F78A6&0&0000
    PowerManagementCapabilities :
    PowerManagementSupported :
    Service : usbaudio
    Status : OK
    StatusInfo :
    SystemCreationClassName : Win32_ComputerSystem
    SystemName : HOBBIT
    Scope : System.Management.ManagementScope
    Path : \\HOBBIT\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_074D&PID_3556&MI_00\\8&285F78A6&0&0000"
    Options : System.Management.ObjectGetOptions
    ClassPath : \\HOBBIT\root\cimv2:Win32_PnPEntity
    Properties : {Availability, Caption, ClassGuid, CompatibleID...}
    SystemProperties : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
    Qualifiers : {dynamic, Locale, provider, UUID}
    Site :
    Container :
    __GENUS : 2
    __CLASS : Win32_PnPEntity
    __SUPERCLASS : CIM_LogicalDevice
    __DYNASTY : CIM_ManagedSystemElement
    __RELPATH : Win32_PnPEntity.DeviceID="USB\\VID_074D&PID_3556&MI_00\\8&3B19294B&0&0000"
    __PROPERTY_COUNT : 24
    __DERIVATION : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
    __SERVER : HOBBIT
    __NAMESPACE : root\cimv2
    __PATH : \\HOBBIT\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_074D&PID_3556&MI_00\\8&3B19294B&0&0000"
    Availability :
    Caption : ZOX DH-60
    ClassGuid : {4d36e96c-e325-11ce-bfc1-08002be10318}
    CompatibleID : {USB\Class_01&SubClass_01&Prot_00, USB\Class_01&SubClass_01, USB\Class_01}
    ConfigManagerErrorCode : 0
    ConfigManagerUserConfig : False
    CreationClassName : Win32_PnPEntity
    Description : Dispositivo de áudio USB
    DeviceID : USB\VID_074D&PID_3556&MI_00\8&3B19294B&0&0000
    ErrorCleared :
    ErrorDescription :
    HardwareID : {USB\VID_074D&PID_3556&REV_0006&MI_00, USB\VID_074D&PID_3556&MI_00}
    InstallDate :
    LastErrorCode :
    Manufacturer : (Áudio USB genérico)
    Name : ZOX DH-60
    PNPDeviceID : USB\VID_074D&PID_3556&MI_00\8&3B19294B&0&0000
    PowerManagementCapabilities :
    PowerManagementSupported :
    Service : usbaudio
    Status : OK
    StatusInfo :
    SystemCreationClassName : Win32_ComputerSystem
    SystemName : HOBBIT
    Scope : System.Management.ManagementScope
    Path : \\HOBBIT\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_074D&PID_3556&MI_00\\8&3B19294B&0&0000"
    Options : System.Management.ObjectGetOptions
    ClassPath : \\HOBBIT\root\cimv2:Win32_PnPEntity
    Properties : {Availability, Caption, ClassGuid, CompatibleID...}
    SystemProperties : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
    Qualifiers : {dynamic, Locale, provider, UUID}
    Site :
    Container :

  • Replace Part of DisplayName Using PowerShell

    Hello,
    I am trying to replace part of a display name using powershell. For example, our display names look like this:
    "Lname, Fname/Department"
    I'm trying to replace only the department, basically what is after the /, from "Information Systems" to "IT"
    Here's what I have but it is failing:
    Get-ADUser "ex10testertesters" | % { Set-AdUser $_ -DisplayName ($_.Displayname -replace 'Information Systems$','IT') }
    Error I am getting is below:
    Set-ADUser : replace
    At line:1 char:48
    + Get-ADUser "test" | % { Set-AdUser <<<<  $_ -DisplayName ($_.Dis
    playname -replace '/Information Systems','IT') }
        + CategoryInfo          : InvalidOperation: (CN=ex10tester...DC=company,DC
       =com:ADUser) [Set-ADUser], ADInvalidOperationException
        + FullyQualifiedErrorId : replace,Microsoft.ActiveDirectory.Management.Com
       mands.SetADUser
    Can anyone assist in what the issue is? Thank you!

    DisplayName is not a default attribute returned by Get-ADUser; you'll need to specify it.
    Get-ADUser "ex10testertesters" -Properties 'DisplayName' | % {
    $newDisplayName = $_.Displayname -replace 'Information Systems$','IT'
    Set-AdUser $_ -DisplayName:$newDisplayName

  • Recently moved and installed ATT DLS - I use their wireless router and connectted my airport express - Now I'm getting the Blue ? on some images

    Recently moved and installed ATT DLS - I use their wireless router and connectted my airport express - Now I'm getting the Blue ? on some images - and at times - videos don't load.  I've increased / deleted Cache.  Suggestions? Misconfig?  Could it be possible my configuration from MacBook to router isn't correct?
    Thanks!

    JG,
    Thanks for the info.
    Couple of questions. I found an apple support document on this topic that opened with this line:
    "AirPort Express and all AirPort Extreme base stations can use WDS. Earlier AirPort base stations can't."
    If the TC is an airport extreme base station, why can't this work to extend the network? I think I misunderstand. Here is the full article:
    http://support.apple.com/kb/HT2044?viewlocale=en_US
    If I buy a new airport extreme, set it to wireless-n only as my main router, am I correct that my existing time capsule could be used as a bridge if plugged in upstairs?
    Final question (and that should do it), could I take this old airport express, plug it in upstairs using the ethernet connection, and just create a separate wireless network to use with a different name?
    I'd like to keep one network if possible but just kicking around short term solutions.
    Thanks again.

  • How do I bulk upload documents using PowerShell and extract metadata from file name?

    I have a requirement to upload a bunch of documents into a document library. Based on the content type, the rules of updating the metadata is different...the one giving me trouble is to extract the metadata from the file name. If I have a file name like
    "part1_part2_part3.pdf" how do I extract part1, part2, part3 and tag each document being uploaded into SharePoint, using PowerShell? I have searched and have not been able to find anything to get me started.
    Has anyone done this before? Or is there a blog I can take a look at? Thanks
     

    You will have to write a PS script encompassing this logic.
    Read files from the folder using
    Get-Item cmdlet
    Determine the content type based on the path or filename.
    Split the file name to extract the tag names.
    If the metadata fields in the content type is a managed metadata field, check whether the term exists and set it.
    Updating SharePoint Managed Metadata Columns
    with PowerShell
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • If I get a user to enter their name as a variable and I am linking one movie to another using a button, is there a way to carry the user name forward into the second movie?

    If I get a user to enter their name as a variable and I am linking one movie to another using a button, is there a way to carry the user name forward into the second movie?

    Hi there
    See if the link below helps
    Click here
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • I was moving bookmarks in safari and 2 complete folders have emptied their contents. The folders are still there. I don't have a working time machine and icloud has caused the relevant folders to disappear from all my machines, iPhone, iPad and iMac

    I was moving bookmarks in safari and 2 complete folders have emptied their contents. The folders are still there. I don't have a working time machine and icloud has caused the relevant folders to disappear from all my machines, iPhone, iPad and iMac as well as thge MacBook Air I was working on. HELP!!!

    Hi,
    There is NO need to put your whole questing in the "Questing Heather" therefore you can TYPE here. In the Text window as I did to.
    Now to your questing:
    So, you moved some Bookmarks and now 2 folders are completely empty.
    I think that they dropped in a other folder during dragging the Bookmarks.
    Did you check ALL of you Bookmark folder if they are there?
    If you didn't delete the they have to be still there.
    Dimaxum

  • When i compose a new message and am typing in the name of the person to send it to it says iMessage after their name but when i click it says "Bonjour (offline) "  my bonjour account isn't even enabled!? and it all used to work fine

    When i compose a new message and am typing in the name of the person to send it to it says iMessage after their name but when i click it says "Bonjour (offline) "  my bonjour account isn't even enabled!? and it all used to work fine please help!

    Hi,
    I invoked New Mesage
    I typed a Name in Manually (rather than using the blue + icon)
    I clicked on the "to" name and got this
    Uploaded with Skitch!
    I don't get a Bonjour Option here.
    I do get a Jabber ID showing up for them but for soem reason it does not list my "From" account.
    I would say that I have seen multiple "To"s and the same for the "From" choices and I think I have seen the Bonjour one listed.
    However the "To" And "From"s don't seem to match and it appears you can iMessage Jabber names/ID or Jabber AIM names (which you can't in either case)
    10:06 PM      Thursday; March 8, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How to Use PowerShell to Delete FIM Users That Have a Null attribute name

    FIM Community Information Center Article
    Wiki Page:
    How to Use PowerShell to Delete FIM Users That Have a Null <attribute name>
    Go to the FIM Community Information Center
    Mike Crowley | MVP
    My Blog --
    Planet Technologies

    Have you run side-by-side metrics on this?
    I've run the Delete Object method and your script against similar data sets and yours appears to take a fair bit longer. I'd have to re-run in identical circumstances, a few times, to really say for sure, but my initial impression is that it will take hours
    longer.
    I guess the point is somewhat moot anyway, as for me the bit that generally takes longest is the actual query, rather than the deletions.
    Boy how I wish I could just enter something into the FIM Portal directly that would blast out a bunch of users matching a query. One day...
    FIMSpecialist.com | MCTS: FIM 2010 | Now Offering
    ECMA1->ECMA2 Upgrade Services

  • Using powershell to name a device after imaging

    Hi All,
    I am trying to use a combination of a preboot bundle and powershell scripts to name a pc after initial imaging or reimaging.
    - Reimaging seems to work as long as the pc is joined to the windows domain after installation of zcm11.2.4 client
    but
    what is a reliable way to obtain the computer name for a pc not previously imaged, and name the device after imaging. I have been trying to use powershell scripts as per https://www.novell.com/communities/c...-registration/ .... but I seem to be missing something (I also do not have the HP bios utility available).
    Any ideas or words to provide clarity would be appreciated.
    Thank you
    Peter

    pjdawson wrote:
    >
    > Hi All,
    >
    > I am trying to use a combination of a preboot bundle and powershell
    > scripts to name a pc after initial imaging or reimaging.
    >
    > - Reimaging seems to work as long as the pc is joined to the windows
    > domain after installation of zcm11.2.4 client
    > but
    >
    > what is a reliable way to obtain the computer name for a pc not
    > previously imaged, and name the device after imaging. I have been
    > trying to use powershell scripts as per
    > https://www.novell.com/communities/c...-7-automated-i
    > maging-and-zcm-registration/ .... but I seem to be missing something
    > (I also do not have the HP bios utility available).
    >
    > Any ideas or words to provide clarity would be appreciated.
    >
    > Thank you
    >
    > Peter
    Hi
    Not sure I get what the issue is? It works, no? Is it the order
    that's the problem?
    Are you not able to rename with PS, or?
    Niels
    A true red devil...
    If you find this post helpful, please show your appreciation by
    clicking on the star below
    A member must be logged in before s/he can assign reputation points.

  • How to rename computer account using Powershell 2.0

    Hi,
    For my Win7 deployment environment i need a script that can rename my workstation and it's Active Directory computer account.
    Is this possible using Powershell 2.0 included in Win7?

    I created a PowerShell script that, among other things, renames the computer.
    Function Rename-Computer ([string]$NewComputerName) {
    $comp = (gwmi win32_computersystem).Name.Trim()
    $ComputerInfo = Get-WmiObject -Class Win32_ComputerSystem
    Write-Host "Renaming computer...`n`tOld name: $comp`n`tNew name: $apnewname"
    #Start-Sleep (10)
    $ComputerInfo.rename($NewComputerName) | Out-Null
    After that you should reboot
    function RestartMachine{
    $os = gwmi win32_operatingsystem
    $os.psbase.Scope.Options.EnablePrivileges = $True
    $os.Reboot()
    Or better yet just use the `Restart-Computer` cmdlet built into PoSH.
    Now, the original post also said there was a need to rename the computer object n AD.  Below are two functions I use primarily for moving AD objects into their appropriate OU home.  While that doesn't immediately answer the question or solve the
    problem, I do believe you can rename the object you bind to using a very similar method.
    # This was created with the idea that machines would join the
    # domain automatically, into a predetermined OU. From there,
    # we would determine which OU the machine should be in, then
    # move it by calling this function.
    function MoveOU ($newOU) {
    $comp = (gwmi win32_computersystem).Name.Trim()
    $dumpOU = "CN=Computers,"
    # DC=dc,DC=net
    $root = [adsi]""
    #CN=Computers,DC=dc,DC=net
    $srcOU = [adsi]("LDAP://"+$dumpOU+$root.distinguishedName)
    #OU=fixedOU,OU=testOU,DC=dc,DC=net
    $destOU = [adsi]("LDAP://OU=fixedOU,OU=testOU,"+$root.distinguishedName)
    #CN=COMPUTERNAME,CN=Computers,DC=dc,DC=net
    $admin = [adsi]("LDAP://CN="+$comp+","+$srcOU.distinguishedName)
    #$admin.psbase | get-member | where-object {$_.Name -eq "MoveTo"}
    #System.Void MoveTo(DirectoryEntry newParent), System.Void MoveTo(DirectoryEntry newParent, String newName)
    $admin.PSBase.MoveTo($destOU)
    Function Move-OU ($SiteDC, $newOU) {
    $computerName = (gwmi win32_computersystem).Name.Trim()
    $_computerType = "CN=Computer,CN=Schema,CN=Configuration,DC=dc,DC=net"
    $path = "LDAP://$SiteDC/DC=dc,DC=net"
    $domain = "domain"
    $user = "user"
    $pass = "password"
    $de = New-Object System.DirectoryServices.DirectoryEntry($path,"$domain\$user",$pass)
    $ds = New-Object System.DirectoryServices.DirectorySearcher($de)
    $ds.Filter = "(&(ObjectCategory=computer)(samaccountname=$computerName$))"
    $res = $ds.FindAll()
    if ($res.count -gt 0) {
    # Machine has been found
    # Bind to the Computer Object in AD
    $oldComputerObject = New-Object System.DirectoryServices.DirectoryEntry($res[0].path,"$domain\$user",$pass)
    #$oldOU = $oldComputerObject.distinguishedName
    $oldOU = $oldComputerObject.Path
    Else {
    $strFilter = "(Name=$computerName)"
    $objDomain = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$SiteDC/dc=dc,dc=net","$domain\$user",$pass)
    $objSearcher = New-Object System.DirectoryServices.DirectorySearcher($objdomain)
    $objSearcher.SearchRoot = $objDomain
    $objSearcher.PageSize = 1000
    $objSearcher.Filter = $strFilter
    $objSearcher.SearchScope = "Subtree"
    $colPropList = "distinguishedName", "Name"
    foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i) | Out-Null}
    $colResults = $objSearcher.FindAll()
    #$colResults.Count
    if($colResults.count -gt 0) {
    foreach($result in $colResults) { $target = $result.Properties }
    $Error.Clear()
    #$oldOU = $target.distinguishedname
    $oldOU = [string]$target.adspath
    Else {
    write-host "`tWARNING: Unable to locate $computername in AD; Cannot move to correct OU"
    ErrorLog "WARNING: Cannot move object $computername to correct OU; Not found in AD."
    $destOU = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$SiteDC/$newOU","$domain\$user",$pass)
    $oldComputerObject.PSBase.MoveTo($destOU)
    /\/\o\/\/ who has been known to dabble in scripting a bit (;) has also covered this subject here.  I would copy & paste, but I highly recommend reading it to get a better understanding of what's going on.  Plus, there's LOADS of useful information
    on that site!
    http://mow001.blogspot.com/2006/09/powershell-active-directory-part-11.html

  • How do I recover external drive folders put in the trash using another comp

    Using a different computer than my own, I moved folders from an external firewire disk to the trash - but did not empty the trash. I'm now using the external disk with my own computer and would like to permanently delete those files (e.g. empty the trash). However, I cannot view those folders in the trash on my own computer. It is not convenient for me to take my external drive back to the other computer. Without being able to empty those folders from the trash, I cannot recover that space (40Gig) occupied by those folder on the external hard drive.
    Is there a way to "empty trash" those files so that I can recover that disk space.
    Powerbook G4   Mac OS X (10.4.6)  
    Powerbook G4   Mac OS X (10.4.6)  

    Hi, barleycor. Welcome to the Discussions.
    Here are the detailed instructions you need to remove the files trashed when the FireWire drive was connected to another computer.
    The Trash on a FireWire drive is actually in a series of folders within the hidden and invisible directory:
    /Volumes/partition_name/.Trashes
    where partition_name is the name of the partition or volume on the FireWire drive on which the files were trashed. If the FireWire drive is a single partition, then partition_name is the same as the name of the FireWire drive.
    Within that directory is a subdirectory for each user on that trashed files while using the FireWire drive. Each user-specific subdirectory's name is the NetInfo uid (user ID) number of the user.
    We will use Terminal (located in your Macintosh HD > Applications > Utilities folder) to find the files and empty the Trash.
    First, Launch Terminal by double-clicking its icon in your Macintosh HD > Applications > Utilities folder.
    We can see all of the Trash-related subdirectories on the FireWire partition in question, including their contents, using the following Terminal command:
    sudo -alhR "/Volumes/partition_name/.Trashes"
    It must be typed exactly as written after the Terminal prompt (% in the following examples), save you must substitute the correct value for partition_name in the command. Note that Terminal commands are case-sensitive.
    After typing the command, again substituting the correct value for partition_name, you press Return and type your Admin password when prompted. You should see a listing like the following when I look at the .Trashes folder on the Spare partition of one of my FireWire drives:
    % sudo ls -alhR "/Volumes/Spare/.Trashes"
    Password:
    total 0
    d-wx-wx-wx 3 unknown unknown 102B Apr 22 05:25 .
    drwxrwxrwx 31 unknown unknown 1K Apr 25 04:02 ..
    drwx------ 4 unknown unknown 136B Apr 25 04:02 501
    /Volumes/Spare/.Trashes/501:
    total 33664
    drwx------ 4 unknown unknown 136B Apr 25 04:02 .
    d-wx-wx-wx 3 unknown unknown 102B Apr 22 05:25 ..
    -rw------- 1 unknown unknown 6K Apr 25 04:01 .DS_Store
    -rw-r--r-- 1 unknown unknown 16M Nov 14 15:44 Test.fp7
    The first line highlighted in yellow above is the only user-specific subdirectory within the /Volumes/partition_name/.Trashes directory. That subdirectory's name is 501 .
    The block of lines highlighted in yellow lists the contents of the Trash on that FireWire volume for the user whose NetInfo uid is 501, generally the first user defined on the Mac. We can see that this directory contains the file
    Test.fp7
    that I moved to the Trash on that volume (it's shown in the last line in the block of yellow lines above).
    You would use the same process to find the 5xx directory containing the files you moved to the Trash when the FireWire drive was connected to a different computer.
    To empty the Trash for the user whose NetInfo uid is 501 on the Spare volume, I would type the following command:
    sudo rm -ri "/Volumes/Spare/.Trashes/501/"
    press Return, then type my Admin password if prompted. This would then prompt me to confirm if I wanted to remove every file in the 501 trash subdirectory including the subdirectory itself. I would respond y for "yes" to every question except the last, to which I would respond n for "no." Here's what that looks like in Terminal:
    % sudo rm -ri "/Volumes/Spare/.Trashes/501/"
    Password:
    examine files in directory /Volumes/Spare/.Trashes/501/? y
    remove /Volumes/Spare/.Trashes/501//.DS_Store? y
    remove /Volumes/Spare/.Trashes/501//Test.fp7? y
    remove /Volumes/Spare/.Trashes/501/? n
    I've highlighted my y and n responses in green and red, respectively, so you can distinguish them from the prompts. I respond n to the last question as I want to keep the 501 subdirectory.
    So, once you've found the 5xx subdirectory containing the files you trashed when the FireWire drive was connected to the other computer, you'd use the command:
    sudo rm -ri "/Volumes/partition_name/.Trashes/5xx/"
    substituting the correct values for partition_name and 5xx, and typing y for "yes" in response to each prompt except the last prompt, e.g.
    remove /Volumes/partition_name/.Trashes/5xx/?
    to which you would respond n for "no." The files trashed when the FireWire drive was connected to the other Mac are now gone from the FireWire drive.
    When completed, you end your Terminal session as follows:
    1. At the Terminal prompt, type: exit
    2. Press Return.
    3. Quit (Command-Q) Terminal.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Search and Replace text in file using PowerShell

    I want to schedule a script in PowerShell to search a directory for an XML file for a particular text string and replace it with a different text string and then save the file with the same name, the name of the file
    will change each time the script is run on a daily basis. There will only be one XML file in the location when the scheduled script is run.
    I have never used PowerShell but am familiar with batch file commands, can anyone please help!!
    KevinS

    Hi Kevin,
    I’m writing to just check in to see if the suggestions were
    helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please
    click here.
    Best Regards,
    Anna
    TechNet Community Support

Maybe you are looking for

  • IPhone 4 - Pioneer Speaker System No Longer Works After Firmware Update

    To Whom It May Concern, I recently updated the firmware on my iPhone 4 from 4.1 to 4.2.1. Unfortunately, as soon as I did that my Pioneer (XW-NAV1K-K) Speaker System no longer works with my iPhone. Are there plans on correcting this in the next firmw

  • Exchange rate customizing - SKK/EUR

    As Slovakia will be joining the Euro area on 01.01.2009, I did the currency customizing as explained in OSS Note 1231768. In this note is mentioned to one time add the official fixed exchange rate using transaction OB08, with validity date 01.01.1800

  • Can I replace a damaged iTouch 4G for a refurbished white iTouch 4G?

    Can I replace a damaged iTouch 4G for a refurbished white iTouch 4G?

  • Issues w/ Intensity Pro on Mac

    Hi everyone, New to PP 5.5.0 (coming from FCP). I'm using a Blackmagic Intensity Pro card for external monitoring and I'm having 2 issues: 1. I can view video out thru the card but don't get audio when playing from the sequence or program monitor no

  • 10.4.8 Update on G5 2Ghz

    Hi, I just did an update on my G5 2Ghz to 10.4.8 from 10.4.7 and now I can't get to my login screen! I am getting "Darwin/BSD (username) (console) and then login: I type my login and password and I get /Users/username\> . What am I supposed to do? Pl