简体   繁体   English

如何在批处理程序中打开文件?

[英]How do i open a file in a program with batch?

I want to open a file that is in a directory down ( folder/file.bat ) but i want to open it in Notepad++ not cmd.exe. 我想打开目录中的文件( folder/file.bat ),但我想在Notepad ++中打开它而不是cmd.exe。 And i want to do this without changing the default program. 我想在不更改默认程序的情况下执行此操作。

How would i do this in batch 我将如何批量执行此操作

I've tried this: 我试过这个:

start "" "C:\Program Files (x86)\Notepad++\notepad++.exe" -%server%\run.bat

But it doesn't work. 但它不起作用。

I didnt exactly understand your question. 我并不完全理解你的问题。 But from what I understood I tried the following. 但从我的理解,我尝试了以下。

For me I just tried simply putting the filename as an argument to notepad++.exe In my example I kept the file in D:\\Test\\Notepad++.bat and the Test file Test.txt in D:\\Test.txt I wrote this command and it works for me 对我来说,我只是尝试将文件名作为参数记录到++ .exe在我的例子中,我将文件保存在D:\\ Test \\ Notepad ++。bat和D:\\ Test.txt中的测试文件Test.txt我写了这个命令它对我有用

start "" "C:\Program Files\Notepad++\notepad++.exe" ..\Test.txt

Hope it helps 希望能帮助到你

The link here shows the command line arguments which can be passed to notpad++.exe 此处的链接显示了可以传递给notpad ++。exe的命令行参数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM