TMSUSERS Archives

The Museum System (TMS) Users

TMSUSERS@SI-LISTSERV.SI.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Chad Petrovay <[log in to unmask]>
Reply To:
The Museum System (TMS) Users
Date:
Mon, 22 Mar 2021 10:38:08 -0400
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (3094 bytes) , text/html (8 kB)
External Email - Exercise Caution
Sorry to come late to the party, but you can do ALL of this in SQL on MS SQL Server. If you enable xp_cmdshell on MS SQL Server, you can execute DOS prompts (who remembers good old DOS prompts?) from within SQL. This means that you can use DOS to rename, copy, or move files.

    SELECT @SQL = CONCAT('EXEC XP_cmdshell ''ren \\path\to\file\',@OldFile,' ',@NewFile,''', no_output ');
    EXEC sp_executesql @SQL;

I usually load the candidates into a temp table, then within a loop, I extract the variables (including a variable for the new filename), use xp_cmdshell to rename the file, and then update the filename in the MediaFiles table.

As a bonus, if you have ImageMagick installed on the same server as your MS SQL Server instance, you can also execute ImageMagick commands with xp_cmdshell.

I have used this technique to rename Non-Morgan images with their loan numbers, to archive loan images into folders by year, to consolidate some legacy media into a central file folder, etc.


On Fri, Feb 19, 2021 at 9:53 AM Amanda Shields <[log in to unmask]<mailto:[log in to unmask]>> wrote:
External Email - Exercise Caution
Hi all,

Our institution has included our object ID as the filename for many years including the punctuation_2018.4.jpg etc.  As we are starting to institute digital preservation policies and procedures, it was recommended to remove periods and add in an underscore and only have periods as part of the file extension.  This would mean renaming the thousands of files on our servers and files in TMS.  Has anyone performed a similar update or have any other recommendations?

Thanks,

Amanda


Amanda Shields

Associate Registrar



••••••••••••••••••••••••••••••••••••••••••••••



BRANDYWINE

RIVER MUSEUM

OF ART



P.O. Box 141

Chadds Ford, PA 19317



610.388.8134

Brandywine.org<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.brandywine.org%2F&amp;data=04%7C01%7CTMSUSERS%40si-listserv.si.edu%7C99e5a9acadc34900a4b308d8ed4023e7%7C989b5e2a14e44efe93b78cdd5fc5d11c%7C0%7C0%7C637520207027066281%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=pmw1VAKZr2KC%2Bfi9c%2FZ3T1lyqWPGbEB2SL%2FOuXlpJoY%3D&amp;reserved=0>


[X]


To unsubscribe, send an email to [log in to unmask]<mailto:[log in to unmask]> with the following commands in the body of the email:

signoff TMSUSERS

// eoj

You will receive a confirmation that your subscription has been removed.

To unsubscribe, send an email to [log in to unmask] with the following commands in the body of the email:

     signoff TMSUSERS

     //  eoj


You will receive a confirmation that your subscription has been removed.


ATOM RSS1 RSS2