安装.bat文件
我需要做的是制作一个 .bat 脚本,该脚本将从我的服务器中提取安装文件,并在工作站上启动它们以由工作站上的用户安装程序。这 1 个程序总共有 8 个安装,必须按顺序启动。
关于用于拉取安装文件的命令或如何使用 PS exec 进行安装有什么想法吗?我没有任何可做的,我所做的所有研究都以其他方式进行,然后制作了安装脚本。
What I need to do is make a .bat script that will pull the install files from my server and launch them on a workstation to install a program, by a user on the workstation. There are 8 installs total for this 1 program and they have to be launched in order.
Any ideas on commands used to pull install files or how to use PS exec to install? I don't have anything to go with, all the research I did took me in other ways then making an install script.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,我可以通过在 cmd 提示符下玩弄自己来解决这个问题。我尝试了一系列命令,但没有成功,然后我只尝试了由暂停分隔的文件路径,对于任何寻找简单脚本来启动 .exe 的人来说,它都有效:(引号是文件路径中是否有空格)
在 cmd 提示符或保存为 .bat 文件的记事本中
- "\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 01\setup.exe"
Pause
"\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 02\setup.exe”
暂停
“\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 03\setup.exe
”暂停
“\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 04\setup.exe”
暂停
I was actually able to figure it out on my own by playing around in cmd prompt. I tried a series of commands with no luck then I tried just the file paths separated by a pause and it worked so for anyone looking for a simple script to launch .exe's: (the quotations are if there are any spaces in the file path)
In cmd prompt or in notepad saved as a .bat file-
"\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 01\setup.exe"
Pause
"\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 02\setup.exe"
pause
"\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 03\setup.exe"
pause
"\\000.00.00.00\programs\Apps\ProgramsBASELINE\cd install 04\setup.exe"
pause
我建议使用
START /WAIT
命令。它将等待每个安装程序完成后再开始下一个安装,无需用户交互。在每次设置之间放置PAUSE
将强制用户按 Enter 键 4 次。如果您想从服务器运行bat 文件并将bat 文件与安装程序一起保留在服务器上,我还建议您研究PUSHD
。这样您就可以从服务器执行 bat 文件,将其指向连接到您想要的网络的任何计算机,然后运行它。例如(使用开始/等待):
I'd suggest using the
START /WAIT
command. It will wait for each setup program to finish before beginning the next install, without the need for user interaction. Putting aPAUSE
in between each setup will force the user to press the enter key 4 times. I'd also suggest looking intoPUSHD
if you want to run the bat file from a server and keep the bat file on the server along with the install programs. This way you could execute the bat file from the server, point it at whichever computer connected to the network you want, and run it.ex (using START /WAIT):