如何从记事本执行makecab/f命令?
如何使用文本文件运行位于文件夹中的命令。这是当前的命令
C:\Program Files\GAPS\XML Forms\CSurvey\temp>makecab/f directories.txt
,我可以使用记事本运行此路径“C:\Program Files\GAPS\XML Forms\CSurvey\temp”,使用以下内容作为记事本内容
cmd /k "cd C:\Program Files\GAPS\XML Forms\CSurvey\temp"
但我无法运行 makecab/fdirectories.txt
来自记事本。如何修改记事本内容,使makecab/fdirectories.txt
自动执行,而无需在运行窗口手动输入命令?
How can I run a command that is located in a folder using a text file. Here is the command
C:\Program Files\GAPS\XML Forms\CSurvey\temp>makecab/f directories.txt
currently I am able to run upto this path "C:\Program Files\GAPS\XML Forms\CSurvey\temp" using notepad by using the following as a notepad content
cmd /k "cd C:\Program Files\GAPS\XML Forms\CSurvey\temp"
But i'm not able to run the makecab/f directories.txt
from notepad. how to modify the notepad content so that the makecab/f directories.txt
will execute automatically without manually typing the command in run window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您希望能够使用文本文件运行上述命令?
这没有多大意义,但也许由于您的英语水平,我可以尝试回答您的问题
打开一个新的记事本文本文件。
键入您要运行的命令:
请注意,您需要指定
directories.txt
的完整路径,因为您将从其他地方运行此命令,需要确保路径正确。将文件另存为
SomeFileName.bat
注意,必须使用.bat
保存,而不是.txt
否则,该文件将不会被保存。可执行的。另外,请确保 Windows 没有隐藏已知扩展名,以避免将您的文件命名为:YourFileName.bat.txt
。I assume you want to be able to run the above command using a text file?
That does not make much sense, but maybe due to your English level, I can try to answer your question
Open a new notepad text file.
Type the command you want to run:
Notice that you need to specify full path for
directories.txt
because since you will run this command from somewhere else, you would need to make sure the path is correct.Save the file as
SomeFileName.bat
notice that you must save it with.bat
not.txt
otherwise, the file will not be executable. Also, make sure Windows is not hiding known extensions to avoid having your file named:YourFileName.bat.txt
.有两种方法可以解决您的问题。
如果您希望命令窗口在完成作业后保持打开状态,请将这一行: 更改
为这一行:
不过,您也可以在完成批处理脚本后自动关闭命令窗口。在这种情况下,请用以下两行替换您的命令:
请注意缺少
cmd /k
。当您启动脚本时,命令窗口将自动打开,并且在脚本执行时它将保持打开状态。There are two ways of solving your problem.
If you want the command window to remain open after finishing the job, then change this line:
to this one:
Alternatively, though, you could have the command window close automatically upon completing the batch script. In that case replace your command with these two lines:
Note the absence of
cmd /k
. The command window will automatically open when you start the script and it will stay open while the script is executing.