Advertisement
Guest User

MailProfile

a guest
Feb 17th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 9.55 KB | None | 0 0
  1. @ECHO Off & COLOR 1F & TITLE [OUTLOOK PROFILE MAKE] >NUL
  2.  
  3. ( SETLOCAL EnableExtensions EnableDelayedExpansion
  4.     IF EXIST "!APPDATA!\Microsoft\Outlook" GOTO :END
  5.     SET "sPRFPath=!TEMP!\profile.prf"
  6.    
  7.     SET "sEmailAddress=admin@domain.com"
  8.    
  9.     SET "sAccountName=admin"
  10.     SET "sAccountType=POP3"
  11.    
  12.     SET "sSendServer=mail.domain.com"
  13.     SET "sSendUseSSL=0"
  14.     SET "sSendPort=25"
  15.    
  16.     SET "sReceiveServer=mail.domain.com"
  17.     SET "sReceiveUseSSL=0"
  18.     SET "sReceivePort=110"
  19.    
  20.     IF EXIST "%~dpn0.ini" FOR /f "usebackq tokens=1,2" %%I IN ("%~dpn0.ini") DO (
  21.         IF "%%I" EQU "EmailAddress:" IF "%%J" NEQ "" SET "sEmailAddress=%%J"
  22.         IF "%%I" EQU "AccountName:" IF "%%J" NEQ "" SET "sAccountName=%%J"
  23.         IF "%%I" EQU "AccountType:" IF "%%J" NEQ "" SET "sAccountType=%%J"
  24.         IF "%%I" EQU "SendServer:" IF "%%J" NEQ "" SET "sSendServer=%%J"
  25.         IF "%%I" EQU "SendUseSSL:" IF "%%J" NEQ "" SET "sSendUseSSL=%%J"
  26.         IF "%%I" EQU "SendPort:" IF "%%J" NEQ "" SET "sSendPort=%%J"
  27.         IF "%%I" EQU "ReceiveServer:" IF "%%J" NEQ "" SET "sReceiveServer=%%J"
  28.         IF "%%I" EQU "ReceiveUseSSL:" IF "%%J" NEQ "" SET "sReceiveUseSSL=%%J"
  29.         IF "%%I" EQU "ReceivePort:" IF "%%J" NEQ "" SET "sReceivePort=%%J"
  30.     ) ELSE (
  31.         ECHO [Config]>%~dpn0.ini
  32.         ECHO EmailAddress:  !sEmailAddress!>>%~dpn0.ini
  33.         ECHO AccountName:   !sAccountName!>>%~dpn0.ini
  34.         ECHO AccountType:   !sAccountType!>>%~dpn0.ini
  35.         ECHO SendServer:    !sSendServer!>>%~dpn0.ini
  36.         ECHO SendUseSSL:    !sSendUseSSL!>>%~dpn0.ini
  37.         ECHO SendPort:  !sSendPort!>>%~dpn0.ini
  38.         ECHO ReceiveServer: !sReceiveServer!>>%~dpn0.ini
  39.         ECHO ReceiveUseSSL: !sReceiveUseSSL!>>%~dpn0.ini
  40.         ECHO ReceivePort:   !sReceivePort!>>%~dpn0.ini
  41.         :CONFIG
  42.         ECHO Your config %~dpn0.ini is default! Please check it's infomations.
  43.         SET /p "sConfig=Continue with default setting. [Yes/No]: "
  44.         IF /i "!sConfig!" EQU "No" GOTO :END
  45.         IF /i "!sConfig!" EQU "Yes" GOTO :CONTINUE
  46.         GOTO :CONFIG
  47.     )
  48.    
  49.     :CONTINUE
  50.     SET "sTrue=1" & SET "sFalse=0"
  51.     ECHO [General]>!sPRFPath!
  52.     ECHO Custom=!sTrue!>>!sPRFPath!
  53.     ECHO ProfileName=MyOutlookProfile>>!sPRFPath!
  54.     ECHO DefaultProfile=Yes>>!sPRFPath!
  55.     ECHO OverwriteProfile=Yes>>!sPRFPath!
  56.     ECHO ModifyDefaultProfileIfPresent=FALSE>>!sPRFPath!
  57.     ECHO. >>!sPRFPath!
  58.    
  59.     ECHO [Service List]>>!sPRFPath!
  60.     ECHO Service1=Outlook Address Book>>!sPRFPath!
  61.     ECHO. >>!sPRFPath!
  62.    
  63.     ECHO [Internet Account List]>>!sPRFPath!
  64.     ECHO Account1=MyOutlook>>!sPRFPath!
  65.     ECHO. >>!sPRFPath!
  66.    
  67.     ECHO [Service1]>>!sPRFPath!
  68.     ECHO. >>!sPRFPath!
  69.    
  70.     ECHO [Account1]>>!sPRFPath!
  71.     ECHO UniqueService=No>>!sPRFPath!
  72.     ECHO AccountName=!sAccountName!>>!sPRFPath!
  73.     ECHO !sAccountType!Server=!sReceiveServer!>>!sPRFPath!
  74.     ECHO SMTPServer=!sSendServer!>>!sPRFPath!
  75.     ECHO !sAccountType!UserName=!sAccountName!>>!sPRFPath!
  76.     ECHO EmailAddress=!sEmailAddress!>>!sPRFPath!
  77.     ECHO !sAccountType!UseSPA=!sFalse!>>!sPRFPath!
  78.     ECHO DisplayName=>>!sPRFPath!
  79.     ECHO ReplyEMailAddress=>>!sPRFPath!
  80.     ECHO SMTPUseAuth=!sTrue!>>!sPRFPath!
  81.     ECHO SMTPAuthMethod=!sFalse!>>!sPRFPath!
  82.     ECHO ConnectionType=!sFalse!>>!sPRFPath!
  83.     ECHO LeaveOnServer=0x0>>!sPRFPath!
  84.     ECHO ConnectionOID=MyConnection>>!sPRFPath!
  85.     ECHO !sAccountType!Port=!sReceivePort!>>!sPRFPath!
  86.     ECHO !sAccountType!UseSSL=!sReceiveUseSSL!>>!sPRFPath!
  87.     ECHO ServerTimeOut=60>>!sPRFPath!
  88.     ECHO SMTPPort=!sSendPort!>>!sPRFPath!
  89.     ECHO SMTPUseSSL=!sSendUseSSL!>>!sPRFPath!
  90.     ECHO. >>!sPRFPath!
  91.    
  92.     ECHO [Microsoft Exchange Server]>>!sPRFPath!
  93.     ECHO ServiceName=MSEMS>>!sPRFPath!
  94.     ECHO MDBGUID=5494A1C0297F101BA58708002B2A2517>>!sPRFPath!
  95.     ECHO MailboxName=PT_STRING8,0x6607>>!sPRFPath!
  96.     ECHO HomeServer=PT_STRING8,0x6608>>!sPRFPath!
  97.     ECHO OfflineAddressBookPath=PT_STRING8,0x660E>>!sPRFPath!
  98.     ECHO OfflineFolderPath=PT_STRING8,0x6610>>!sPRFPath!
  99.     ECHO. >>!sPRFPath!
  100.    
  101.     ECHO [Exchange Global Section]>>!sPRFPath!
  102.     ECHO SectionGUID=13dbb0c8aa05101a9bb000aa002fc45a>>!sPRFPath!
  103.     ECHO MailboxName=PT_STRING8,0x6607>>!sPRFPath!
  104.     ECHO HomeServer=PT_STRING8,0x6608>>!sPRFPath!
  105.     ECHO RPCoverHTTPflags=PT_LONG,0x6623>>!sPRFPath!
  106.     ECHO RPCProxyServer=PT_UNICODE,0x6622>>!sPRFPath!
  107.     ECHO RPCProxyPrincipalName=PT_UNICODE,0x6625>>!sPRFPath!
  108.     ECHO RPCProxyAuthScheme=PT_LONG,0x6627>>!sPRFPath!
  109.     ECHO CachedExchangeConfigFlags=PT_LONG,0x6629>>!sPRFPath!
  110.     ECHO. >>!sPRFPath!
  111.    
  112.     ECHO [Microsoft Mail]>>!sPRFPath!
  113.     ECHO ServiceName=MSFS>>!sPRFPath!
  114.     ECHO ServerPath=PT_STRING8,0x6600>>!sPRFPath!
  115.     ECHO Mailbox=PT_STRING8,0x6601>>!sPRFPath!
  116.     ECHO Password=PT_STRING8,0x67f0>>!sPRFPath!
  117.     ECHO RememberPassword=PT_BOOLEAN,0x6606>>!sPRFPath!
  118.     ECHO ConnectionType=PT_LONG,0x6603>>!sPRFPath!
  119.     ECHO UseSessionLog=PT_BOOLEAN,0x6604>>!sPRFPath!
  120.     ECHO SessionLogPath=PT_STRING8,0x6605>>!sPRFPath!
  121.     ECHO EnableUpload=PT_BOOLEAN,0x6620>>!sPRFPath!
  122.     ECHO EnableDownload=PT_BOOLEAN,0x6621>>!sPRFPath!
  123.     ECHO UploadMask=PT_LONG,0x6622>>!sPRFPath!
  124.     ECHO NetBiosNotification=PT_BOOLEAN,0x6623>>!sPRFPath!
  125.     ECHO NewMailPollInterval=PT_STRING8,0x6624>>!sPRFPath!
  126.     ECHO DisplayGalOnly=PT_BOOLEAN,0x6625>>!sPRFPath!
  127.     ECHO UseHeadersOnLAN=PT_BOOLEAN,0x6630>>!sPRFPath!
  128.     ECHO UseLocalAdressBookOnLAN=PT_BOOLEAN,0x6631>>!sPRFPath!
  129.     ECHO UseExternalToHelpDeliverOnLAN=PT_BOOLEAN,0x6632>>!sPRFPath!
  130.     ECHO UseHeadersOnRAS=PT_BOOLEAN,0x6640>>!sPRFPath!
  131.     ECHO UseLocalAdressBookOnRAS=PT_BOOLEAN,0x6641>>!sPRFPath!
  132.     ECHO UseExternalToHelpDeliverOnRAS=PT_BOOLEAN,0x6639>>!sPRFPath!
  133.     ECHO ConnectOnStartup=PT_BOOLEAN,0x6642>>!sPRFPath!
  134.     ECHO DisconnectAfterRetrieveHeaders=PT_BOOLEAN,0x6643>>!sPRFPath!
  135.     ECHO DisconnectAfterRetrieveMail=PT_BOOLEAN,0x6644>>!sPRFPath!
  136.     ECHO DisconnectOnExit=PT_BOOLEAN,0x6645>>!sPRFPath!
  137.     ECHO DefaultDialupConnectionName=PT_STRING8,0x6646>>!sPRFPath!
  138.     ECHO DialupRetryCount=PT_STRING8,0x6648>>!sPRFPath!
  139.     ECHO DialupRetryDelay=PT_STRING8,0x6649>>!sPRFPath!
  140.     ECHO. >>!sPRFPath!
  141.    
  142.     ECHO [Personal Folders]>>!sPRFPath!
  143.     ECHO ServiceName=MSPST MS>>!sPRFPath!
  144.     ECHO Name=PT_STRING8,0x3001>>!sPRFPath!
  145.     ECHO PathToPersonalFolders=PT_STRING8,0x6700>>!sPRFPath!
  146.     ECHO RememberPassword=PT_BOOLEAN,0x6701>>!sPRFPath!
  147.     ECHO EncryptionType=PT_LONG,0x6702>>!sPRFPath!
  148.     ECHO Password=PT_STRING8,0x6703>>!sPRFPath!
  149.     ECHO. >>!sPRFPath!
  150.    
  151.     ECHO [Unicode Personal Folders]>>!sPRFPath!
  152.     ECHO ServiceName=MSUPST MS>>!sPRFPath!
  153.     ECHO Name=PT_UNICODE,0x3001>>!sPRFPath!
  154.     ECHO PathAndFilenameToPersonalFolders=PT_STRING8,0x6700>>!sPRFPath!
  155.     ECHO RememberPassword=PT_BOOLEAN,0x6701>>!sPRFPath!
  156.     ECHO EncryptionType=PT_LONG,0x6702>>!sPRFPath!
  157.     ECHO Password=PT_STRING8,0x6703>>!sPRFPath!
  158.     ECHO. >>!sPRFPath!
  159.    
  160.     ECHO [Outlook Address Book]>>!sPRFPath!
  161.     ECHO ServiceName=CONTAB>>!sPRFPath!
  162.     ECHO. >>!sPRFPath!
  163.  
  164.     ECHO [LDAP Directory]>>!sPRFPath!
  165.     ECHO ServiceName=EMABLT>>!sPRFPath!
  166.     ECHO ServerName=PT_STRING8,0x6600>>!sPRFPath!
  167.     ECHO UserName=PT_STRING8,0x6602>>!sPRFPath!
  168.     ECHO UseSSL=PT_BOOLEAN,0x6613>>!sPRFPath!
  169.     ECHO UseSPA=PT_BOOLEAN,0x6615>>!sPRFPath!
  170.     ECHO DisableVLV=PT_LONG,0x6616>>!sPRFPath!
  171.     ECHO DisplayName=PT_STRING8,0x3001>>!sPRFPath!
  172.     ECHO ConnectionPort=PT_STRING8,0x6601>>!sPRFPath!
  173.     ECHO SearchTimeout=PT_STRING8,0x6607>>!sPRFPath!
  174.     ECHO MaxEntriesReturned=PT_STRING8,0x6608>>!sPRFPath!
  175.     ECHO SearchBase=PT_STRING8,0x6603>>!sPRFPath!
  176.     ECHO. >>!sPRFPath!
  177.    
  178.     ECHO [Microsoft Outlook Client]>>!sPRFPath!
  179.     ECHO SectionGUID=0a0d020000000000c000000000000046>>!sPRFPath!
  180.     ECHO FormDirectoryPage=PT_STRING8,0x0270>>!sPRFPath!
  181.     ECHO WebServicesLocation=PT_STRING8,0x0271>>!sPRFPath!
  182.     ECHO ComposeWithWebServices=PT_BOOLEAN,0x0272>>!sPRFPath!
  183.     ECHO PromptWhenUsingWebServices=PT_BOOLEAN,0x0273>>!sPRFPath!
  184.     ECHO OpenWithWebServices=PT_BOOLEAN,0x0274>>!sPRFPath!
  185.     ECHO CachedExchangeMode=PT_LONG,0x041f>>!sPRFPath!
  186.     ECHO CachedExchangeSlowDetect=PT_BOOLEAN,0x0420>>!sPRFPath!
  187.     ECHO. >>!sPRFPath!
  188.    
  189.     ECHO [Personal Address Book]>>!sPRFPath!
  190.     ECHO ServiceName=MSPST AB>>!sPRFPath!
  191.     ECHO NameOfPAB=PT_STRING8,0x001e3001>>!sPRFPath!
  192.     ECHO PathAndFilename=PT_STRING8,0x001e6600>>!sPRFPath!
  193.     ECHO ShowNamesBy=PT_LONG,0x00036601>>!sPRFPath!
  194.    
  195.     ECHO [MyOutlook]>>!sPRFPath!
  196.     ECHO AccountType=!sAccountType!>>!sPRFPath!
  197.     ECHO AccountName=PT_UNICODE,0x0002>>!sPRFPath!
  198.     ECHO DisplayName=PT_UNICODE,0x000B>>!sPRFPath!
  199.     ECHO EmailAddress=PT_UNICODE,0x000C>>!sPRFPath!
  200.     ECHO !sAccountType!Server=PT_UNICODE,0x0100>>!sPRFPath!
  201.     ECHO !sAccountType!UserName=PT_UNICODE,0x0101>>!sPRFPath!
  202.     ECHO !sAccountType!UseSPA=PT_LONG,0x0108>>!sPRFPath!
  203.     ECHO Organization=PT_UNICODE,0x0107>>!sPRFPath!
  204.     ECHO ReplyEmailAddress=PT_UNICODE,0x0103>>!sPRFPath!
  205.     ECHO !sAccountType!Port=PT_LONG,0x0104>>!sPRFPath!
  206.     ECHO !sAccountType!UseSSL=PT_LONG,0x0105>>!sPRFPath!
  207.     ECHO SMTPServer=PT_UNICODE,0x0200>>!sPRFPath!
  208.     ECHO SMTPUseAuth=PT_LONG,0x0203>>!sPRFPath!
  209.     ECHO SMTPAuthMethod=PT_LONG,0x0208>>!sPRFPath!
  210.     ECHO SMTPUserName=PT_UNICODE,0x0204>>!sPRFPath!
  211.     ECHO SMTPUseSPA=PT_LONG,0x0207>>!sPRFPath!
  212.     ECHO ConnectionType=PT_LONG,0x000F>>!sPRFPath!
  213.     ECHO ConnectionOID=PT_UNICODE,0x0010>>!sPRFPath!
  214.     ECHO SMTPPort=PT_LONG,0x0201>>!sPRFPath!
  215.     ECHO SMTPUseSSL=PT_LONG,0x0202>>!sPRFPath!
  216.     ECHO ServerTimeOut=PT_LONG,0x0209>>!sPRFPath!
  217.     IF /i "!sAccountType!" EQU "POP3" (
  218.         ECHO LeaveOnServer=PT_LONG,0x1000>>!sPRFPath!
  219.     )
  220.     IF /i "!sAccountType!" EQU "IMAP" (
  221.         ECHO CheckNewImap=PT_LONG,0x1100>>!sPRFPath!
  222.         ECHO RootFolder=PT_UNICODE,0x1101>>!sPRFPath!
  223.     )
  224.     ECHO. >>!sPRFPath!
  225.    
  226.     IF EXIST "!ProgramFiles(x86)!\Microsoft Office\Office14\Outlook.exe" CALL "!ProgramFiles(x86)!\Microsoft Office\Office14\Outlook.exe" /importprf "!sPRFPath!" & ECHO| SET "sDone=Done. "
  227.     IF EXIST "!ProgramFiles!\Microsoft Office\Office14\Outlook.exe" CALL "!ProgramFiles!\Microsoft Office\Office14\Outlook.exe" /importprf "!sPRFPath!" & ECHO| SET "sDone=Done. "
  228. )
  229.  
  230. :END
  231.  
  232. ( ENDLOCAL
  233.     ECHO Press any to exit...
  234.     PAUSE >NUL
  235.     EXIT
  236. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement