1

我遇到的问题是在一个批处理文件中,最后我尝试打开两个资源管理器窗口,然后打开一个记事本 .txt 文件,其中包含有关将文件从一个文件夹复制到另一个文件夹的说明。

当我执行批处理文件时,.txt 文件将在两个资源管理器窗口之间打开,而我希望它在顶部打开。有没有办法做到这一点?感谢您的时间!

    explorer "C:\program files (x86)\SEL\SEL5010"
    explorer C:\users\public\temp\SEL5010

    ECHO. >>C:\users\public\temp\SEL5010\Instructions.txt
    ECHO Hello %username%, >>C:\users\public\temp\SEL5010\Instructions.txt
    ECHO. >>C:\users\public\temp\SEL5010\Instructions.txt
    ECHO Copy SEL5010.lic >>C:\users\public\temp\SEL5010\Instructions.txt
    ECHO. >>C:\users\public\temp\SEL5010\Instructions.txt
    ECHO FROM: The C:\users\public\temp\5010 folder.
    ECHO   TO: The C:\Program Files (x86)\SEL\SEL5010 folder. 

    notepad C:\users\public\temp\SEL5010\Instructions.txt
4

2 回答 2

0

当您说“在顶部”时,您的意思是“最大化”吗?在这种情况下,请尝试

 explorer "C:\program files (x86)\SEL\SEL5010"
 explorer "C:\users\public\temp\SEL5010"

 echo Some instructions >%temp%\instructions.txt
 START /MAX notepad %temp%\instructions.txt

有关您可能使用的其他参数的更多信息,请阅读HELP START

但是,如果你只是想显示一些指令,为什么不直接把它们放在控制台中呢?

ECHO Some instructions
PAUSE

或在消息框中?

(echo msgbox "Some instructions" >%temp%\m.vbs) && call %temp%\m.vbs

要进一步详细说明第二种方法,您可以放置​​一个包含文本文件内容的消息框

(echo msgbox  CreateObject^(^"Scripting.FileSystemObject^"^).OpenTextFile^(^"%temp%^\instructions.txt^"^).ReadAll >%temp%\m.vbs) && call %temp%\m.vbs
于 2013-07-24T17:03:33.107 回答
0

这在这里有效:

@ECHO OFF &SETLOCAL
explorer folder1
explorer folder2
PING -n 2 localhost >nul
notepad file
于 2013-07-24T15:34:53.100 回答