• 0

Using VB Script to Configure Outlook Express


Question

I have a script I have modified that I found online for what I needed.

set oShell = wscript.CreateObject("Wscript.Shell")

Function main()
	dim username, domain


	username = inputbox("Enter store number","Outlook Express Profile Creator","Username")

	If username = "" Then
  wscript.Quit(0)
  End If
  
  If username = "Username" Then
 	 while username = "Enter store number"
    username = inputbox("Enter store number)","Outlook Express Profile Creator","Username")
   	 If username = "" Then
   	 wscript.Quit(0)
   	 End If
 	 wend
  End If


'	username = Ltrim(fixme(username))
'	domain = fixme2(domain)

'EXAMPLE STRING FOR RTRIM
'	RTrim(string)

	call placeMailSettings(username, domain)

	msgbox("Configuration Completed Successfully, don't forget to set the password!")
End Function

Function regRead(regStr)
  regRead = oShell.RegRead(regStr)
End Function

Function regWrite(val1,val2,val3)
  oShell.RegWrite val1,val2,val3
End Function

Function regDelete(regStr)
  call oShell.RegDelete(regStr)
End Function

'Function fixme(strValue)
'	dim userEntry
'	userEntry = split(strValue, "@")
'	fixme = userEntry(0)
'End Function

'Function fixme2(strValue2)
'	dim userEntryd
'	userEntryd = split(strValue2, "@")
'	fixme2 = userEntryd(0)
'End Function


'EXAMPLE STRING FOR SPLIT
'	Split(expression[,delimiter])



'----------------------------------------------------------------------------------------
' Place new settings for Mail
'----------------------------------------------------------------------------------------

Function placeMailSettings(theUsername, theDomain)
	On Error Resume Next
	dim newAccountNum, numKeyStr
	dim username, domain
	newAccountNum = regRead("HKCU\Software\Microsoft\Internet Account Manager\Account Name")

	If newAccountNum = "" Then
  newAccountNum = "00000001"
	ElseIf newAccountNum < 9 Then
  newAccountNum = "0000000" & newAccountNum
	Else
  newAccountNum = "000000" & newAccountNum	
	End If

	numKeyStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\"
	call regWrite(numKeyStr, newAccountNum, "REG_SZ")

	username = theUsername
	domain = theDomain

	'Add Account Name
   accName = username & " Mail"
   accNameStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\Account Name"
   call regWrite(accNameStr, accName, "REG_SZ")

	'Add Connection Type
   conType = "3"
   conTypeStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\Connection Type"
   call regWrite(conTypeStr, conType, "REG_DWORD")
   
	'Delete Connection Id
   conId = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\ConnectionId"
   call regDelete(conId)
   
	'Delete Account Id
   accId = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\Account ID"
   call regDelete(accId)

	'Delete IMAP Server
   imapSvr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\IMAP Server"
   call regDelete(imapSvr)

	'Delete HTTP Mail Server
   httpSvr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\HTTPMail Server"
   call regDelete(httpSvr)

	'Set POP3 Server
   pop3svr = "insert pop3 server here"
   pop3svrStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\POP3 Server"
   call regWrite(pop3svrStr, pop3svr, "REG_SZ")

	'Set POP3 Username
   pop3usr = username 
   pop3usrStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\POP3 User Name"
   call regWrite(pop3usrStr, pop3usr, "REG_SZ")

	'Set POP3 Password 2
   pop3pwd = username & "$"
   popPwdStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\POP3 Password2"
   call regWrite(popPwdStr, pop3pwd, "REG_BINARY")

	'Set POP3 Use Sicily
   useSicily = "0"
   useSicilyStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\POP3 Use Sicily"
   call regWrite(useSicilyStr, useSicily, "REG_DWORD")

	'Set POP3 Prompt for Pw
   var promptPw = "0"
   var promptPwStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\POP3 Prompt for Password"
   call regWrite(promptPwStr, promptPw, "REG_DWORD")

	'Set SMTP Server
   smtpSvr = "insert server name here"
   smtpSvrStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\SMTP Server"
   call regWrite(smtpSvrStr, smtpSvr, "REG_SZ")
   
	'Set SMTP Display name
   smtpDisp = username & " Mail"
   smtpSvrStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\SMTP Display Name"
   call regWrite(smtpSvrStr, smtpDisp, "REG_SZ")

	'Set SMTP E-mail address
   smtpEmail = username & "@whatever.com"
   smtpEmailStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\SMTP Email Address"
   call regWrite(smtpEmailStr, smtpEmail, "REG_SZ")

	'Set SMTP Use Sicily
   smtpUseSicily = "2"
   smtpUseSicilyStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\SMTP Use Sicily"
   call regWrite(smtpUseSicilyStr, smtpUseSicily, "REG_DWORD")
   
	'Set New Account to default
   defAccStr = "HKCU\Software\Microsoft\Internet Account Manager\Default Mail Account"
   call regWrite(defAccStr, newAccountNum, "REG_SZ")
   
	'Increment future account number
   futAccNum = newAccountNum + 1
   futAccNumStr = "HKCU\Software\Microsoft\Internet Account Manager\Account Name"
   call regWrite(futAccNumStr, futAccNum, "REG_DWORD")
End Function   
   

call main()

My only problems are;

1)It enables SMTP server authentication(I don't need that) <-----Fixed! Thank you Weenur!

2)It will not set(via popup prompt) the password or save it.

I am very new to this and I pieced this together by doing searches, so if it's sloppy, my apologies. Does anyone know how to change this to prompt for the password and save it? Thanks in advance.

Edited by Maleboligia

4 answers to this question

Recommended Posts

  • 0

Great post

I also a noob new to programing..

can you help me to

set leave copy of message -> tick

Incoming port to 995

ssl - tick

outgoing port to 465

ssl - tick.

=========

'Set Leave Mail On Server

var leavemail = "1"

var leavemailStr = "HKCU\Software\Microsoft\Internet Account Manager\Accounts\" & newAccountNum & "\Leave Mail On Server"

call regWrite(leavemailStr, leavemail, "REG_DWORD")

=============

I tried to modify add the script .. but doesnt work for me.

milion thanks in advanced

Edited by Blue Baby
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I simply don't get why this "OS" exists. Who cares? Great, you can now run a Windows 95-era stupid game, super cool...
    • In the UK the standard edition has been priced at £69.99, the deluxe is £89.99, the super deluxe is .... £119.99 where the hell do they suggest these prices are coming from then! Sorry but at these prices I will not be buying when it comes out. It will be much, much later when the price has dropped considerably!
    • It'll just have $300 dlc instead, several season pass and at every moment you'll be left feeling you purchased the demo by buying the standard or deluxe editions, because the superdeluxe is how they meant to release the game in full.
    • Following higher pricing fears, Take-Two confirms Borderlands 4 won't be $80 by Pulasthi Ariyasinghe Video games going even higher in price has been a controversial subject as of late. Following the bump up to $70 in recent years, which has been vastly adopted by many publishers, now the price is slowly creeping up to be $80 for major releases. However, it seems Take-Two's latest game will not be following this new trend, despite what was being said in earlier reports. Take-Two and Gearbox today confirmed the launch of pre-orders for Borderlands 4, and front and center was the pricing information for the standard edition, which is set at $69.99. It seems the cooperative-focused looter shooter is not following in the footsteps of other high-profile $79.99 releases like Mario Kart World from Nintendo and the upcoming RPG The Outer Worlds from Microsoft. As for why many were expecting the Borderlands title to also be $80, Gearbox boss Randy Pitchford had alluded to the price hike recently. In a social media post in May, Pitchford answered a question from a fan regarding the game possibly being $80, to which he replied, saying that it was not his decision. "If you’re a real fan, you’ll find a way to make it happen," he went on to say, defending a possible $10 price hike. "My local game store had Starflight for Sega Genesis for $80 in 1991 when I was just out of high school working minimum wage at an ice cream parlor in Pismo Beach and I found a way to make it happen." In the end, Borderlands 4 is now confirmed to be releasing at $69.99 for the Standard Edition, with pre-orders available now. At the same time, a $99.99 Deluxe Edition and a $129.99 Super Deluxe Edition have also been confirmed, with each higher tier adding more cosmetic customizations as well as post-launch access to unannounced DLC content. Borderlands 4 launches September 12, 2025, across PC (Steam and Epic Games Store), Xbox Series X|S, and PlayStation 5. A Nintendo Switch 2 release is also planned to land later in 2025.
  • Recent Achievements

    • Explorer
      treker_ed went up a rank
      Explorer
    • Apprentice
      CHUNWEI went up a rank
      Apprentice
    • Veteran
      1337ish went up a rank
      Veteran
    • Rookie
      john.al went up a rank
      Rookie
    • Week One Done
      patrickft456 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      641
    2. 2
      ATLien_0
      274
    3. 3
      +FloatingFatMan
      171
    4. 4
      Michael Scrip
      155
    5. 5
      Steven P.
      140
  • Tell a friend

    Love Neowin? Tell a friend!