Starten Sie ein Programm, wenn ein anderes Programm geöffnet wird

7854
metasequoia

Ich möchte eine Methode zum Starten eines Programms, wenn ein anderes Programm startet. Insbesondere möchte ich ein MS Word-Dokument öffnen und meinen Zitiermanager gleichzeitig öffnen (EndNote unterstützt diese Funktion innerhalb der MS Word-Voreinstellungen, aber ich habe kürzlich den Zitiermanager gewechselt).

Die Batch-Skripts, die ich bisher gesehen habe, einschließlich dieses, passen nicht zur Rechnung. Ich möchte jedes vorhandene Word-Dokument auf meiner Festplatte öffnen und das zweite Programm auslösen können.

0

1 Antwort auf die Frage

3
Karan

One possible solution:

1) Create a batch file such as C:\ViewDoc.bat:

@echo off start "Word" "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE" %1 start "CiteMan" "Drive:\Path\to\Citation Manager.exe" 

Edit the paths as required.

2) Right-click any .DOC file, click on Open with, browse and select the batch file:

1

Make sure the Always use the selected program to open this kind of file option is checked.

3) Do the same with any .DOCX file.

Now when you double-click to open any document, the batch file will run instead of Word directly. It in turn will launch Word and open the selected document, as well as launch the other program you want.


An alternate way to do this with any .DOCM macro-enabled document is to add the following code via the Developer tab / Visual Basic editor:

Private Sub Document_Open() Shell "Drive:\Path\to\Citation Manager.exe" End Sub 

This will auto-launch the specified program whenever the .DOCM is opened.

Das passt zur Rechnung. +1 für das Hinzufügen des .DOCM-Ansatzes metasequoia vor 11 Jahren 0