如何从记事本执行makecab/f命令?

发布于 2024-11-16 17:04:13 字数 428 浏览 2 评论 0原文

如何使用文本文件运行位于文件夹中的命令。这是当前的命令

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仲春光 2024-11-23 17:04:13

我假设您希望能够使用文本文件运行上述命令?

这没有多大意义,但也许由于您的英语水平,我可以尝试回答您的问题

  1. 打开一个新的记事本文本文件。

  2. 键入您要运行的命令:

    C:\Program Files\GAPS\XML Forms\CSurvey\temp>makecab/f "C:\Program Files\GAPS\XML Forms\CSurvey\temp\directories.txt" 
    
  3. 请注意,您需要指定 directories.txt 的完整路径,因为您将从其他地方运行此命令,需要确保路径正确。

  4. 将文件另存为 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

  1. Open a new notepad text file.

  2. Type the command you want to run:

    C:\Program Files\GAPS\XML Forms\CSurvey\temp>makecab/f "C:\Program Files\GAPS\XML Forms\CSurvey\temp\directories.txt" 
    
  3. 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.

  4. 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.

独闯女儿国 2024-11-23 17:04:13

有两种方法可以解决您的问题。

如果您希望命令窗口在完成作业后保持打开状态,请将这一行: 更改

cmd /k "cd C:\Program Files\GAPS\XML Forms\CSurvey\temp"

为这一行:

cmd /k "cd C:\Program Files\GAPS\XML Forms\CSurvey\temp & makecab/f directories.txt"

不过,您也可以在完成批处理脚本后自动关闭命令窗口。在这种情况下,请用以下两行替换您的命令:

cd C:\Program Files\GAPS\XML Forms\CSurvey\temp
makecab/f directories.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:

cmd /k "cd C:\Program Files\GAPS\XML Forms\CSurvey\temp"

to this one:

cmd /k "cd C:\Program Files\GAPS\XML Forms\CSurvey\temp & makecab/f directories.txt"

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:

cd C:\Program Files\GAPS\XML Forms\CSurvey\temp
makecab/f directories.txt

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文