Jump to content


  • 0
jpodlipny

Script to find .pst - rename to .pstx but ignore "Outlook Files"

Question

Hi,

I already have a BAT script to find PST files and rename their extension to .pstx. (This is so that USMT doesn't pick them up in a migration)

 

for /f "delims=" %%i in ('dir /s /b /a-d c:\*.pst') do (ren "%%i" *.pstx)

That works great.

 

But I need this script to ingore any PST files that already reside in the "Outlook Files" folder in Documents. (So that USMT does pick them up in a migration)

 

What command can I incorporate in this script to exclude any PST files in "Outlook Files" ?

 

Any help would be much appreciated. We are using this to migrate users to HVD and we are almost there!

 

 

 

thanks

Jan

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Thanks, but as far as I know, you cannot exclude PST files in some directories and include them in others (You would need to know which direcotries you want to exclude, which is not possible). USMT grabs PST not only because we have it in the miguser.xml script, but also because it's in the migapp.xml script which migrates Outlook settings. So USMT exclusions is not an option here.

We need specifically a script that will rename the PSTs we dont want to migrate.

 

Thanks for you reply.

Share this post


Link to post
Share on other sites

  • 0

Figured it out:

So basically, using xcopy insetad if DIR, with /L which only lists the files it would otherwise have copied. Then using that list to rename to pstx instead of pst.

 

@echo off
subst Z: %Temp%
for /f "delims=" %%i in ('xcopy C:\*.pst Z:\ /S /H /L /EXCLUDE:C:\USMT\SCRIPTS\Excludelist.txt') do (ren "%%i" *.pstx)

 

 

the /EXCLUDE switch points to a text file containing anything you want excluded from the search.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.