1 '**************************************
2 ' Simple script to launch Emacs
3 ' (VB IDE is not required, should work with Windows XP)
10 ' See: http://www.emacswiki.org/cgi-bin/emacs-en/EmacsClient#toc3
11 '**************************************
12 Set objShell
= WScript
.CreateObject("WScript.Shell")
13 Set fso
= CreateObject("Scripting.FileSystemObject")
15 '**************************************
16 ' Check if emacs is already running
17 '**************************************
19 Set objWMIService
= GetObject("winmgmts:\\" & strComputer
& "\root\cimv2")
20 Set colItems
= objWMIService
.ExecQuery("Select * From Win32_Process")
23 For Each objItem
in colItems
24 If InStr(objItem
.CommandLine
, "emacs.exe") Then
29 If WScript
.Arguments
.Count
= 1 Then
31 objShell
.Run("""" & fso
.GetParentFolderName(WScript
.ScriptFullName
) & "\emacsclientw.exe"" -n " & """" & WScript
.Arguments(0) & """")
33 objShell
.Run("""" & fso
.GetParentFolderName(WScript
.ScriptFullName
) & "\runemacs.exe"" " & """" & WScript
.Arguments(0) & """")
37 ' ***** Print the Standard Out, the Usage ***********
38 Wscript
.StdOut
.WriteLine
"Running emacs startup (no arguments)"
40 objShell
.Run("""" & fso
.GetParentFolderName(WScript
.ScriptFullName
) & "\emacsclientw.exe"" -n C:/test.txt")
42 objShell
.Run("""" & fso
.GetParentFolderName(WScript
.ScriptFullName
) & "\runemacs.exe"" ")