简体   繁体   English

如何编辑BATCH启动命令以启动上述文件夹中的文件

[英]How to edit BATCH start command to start a file in folder above

I got folder with HTM offline files for my customers as a benefit. 我为客户准备了包含HTM脱机文件的文件夹。 And the contain is like this: 并且包含是这样的:

Files (folder)   (with Plus.htm)
Autorun.inf
Icon.ico
START_THIS.bat

In Files folder are HTM files and downlodables and everything... I would like to edit BATCH file to run ONE .htm file in the "Files" folder. 在“文件”文件夹中是HTM文件,可下载文件以及其他所有内容...我想编辑批处理文件以在“文件”文件夹中运行一个.htm文件。 I am able to do that if I got the .htm file in SAME folder as batch, but I wasn't able to edit it to run it in folder above batch. 如果我将.htm文件作为批处理保存在SAME文件夹中,则可以执行此操作,但是我无法对其进行编辑以在批处理以上的文件夹中运行它。

My batch file as it is now (and as it worked with .htm in same folder): 我现在的批处理文件(以及与同一文件夹中的.htm一起使用的文件):

@echo Starting CD now...
@start Plus.htm
@cls
@exit

I tried to edit it so it would work with my folder structure: 我尝试对其进行编辑,以便它可以与我的文件夹结构一起使用:

@echo Starting CD now...
@CD "Files"
@start Plus.htm
@cls
@exit

But this doesn'T worked an I got this error: 但这不起作用,我得到了这个错误:

'\\kostka\\install\\Ostatni\\Marketing\\Plus\\DVD\\Inventor Plus 2016' CMD.EXE was started with the above path as the current directory. 使用上述路径作为当前目录启动了“ \\ kostka \\ install \\ Ostatni \\ Marketing \\ Plus \\ DVD \\ Inventor Plus 2016” CMD.EXE。 UNC paths are not supported. 不支持UNC路径。 Defaulting to Windows directory. 默认为Windows目录。 Starting CD now... The system cannot find the path specidied. 立即启动CD ...系统找不到指定的路径。

Any help please? 有什么帮助吗? I tried to think anither way for customers to have only one exe file but this is only way that I fot so far :( Thank you a lot. 我试图为客户提供另一种方式来拥有一个exe文件,但这是到目前为止我唯一的方式:(非常感谢。

start %~dp0\\Files\\Plus.htm

%dp0扩展到批处理文件所在的目录

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

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