Need advise launching 2013 Outlook from a DOS command line

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
brh56
Posts: 8
Joined: 29 Apr 2015 08:59

Need advise launching 2013 Outlook from a DOS command line

#1 Post by brh56 » 29 Apr 2015 11:48

Good day.

I've been trying to launch an email from a DOS command line using the string shown below. The Microsoft Outlook version is 2013, OS is Windows 7.
The command works without the variables, %subj% and %site%; I've tried various permutations, ie. %subj% %%subj ^%subj% ^%subj^% \%subj%, none of which work.

Code: Select all

@echo off
echo Mail test
set /p subj= Enter SubjectID:
set /p site= Enter Decription:
echo.
call "C:\Program Files (x86)\Microsoft Office\Office15\outlook.exe" /c ipm.note /m "tester1@gmail.com; tester2@gmail.com&subject=New subject %subj%&body=This is a test for a new %site%.

Anybody have an answer?

Regards,
Bjoern

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Need advise launching 2013 Outlook from a DOS command li

#2 Post by Squashman » 29 Apr 2015 12:49

The variables should work just fine surrounded by a single percent symbol on each side of the variable name.

Looks like you are missing the closing quote.

Post Reply