问题描述
我需要一个以下脚本的vbs。它用于从网络共享中推出office365更新。它会检查已安装的版本,如果没有找到,
将运行安装程序。用户无法看到所有此过程,因此我启用了计算机 配置>管理模板>系统>脚本并启用运行启动脚本可见选项。这个问题是我还使用office365安装UI获得了命令
提示,并且已经读过vbs 没有显示命令执行部分,用户只会看到软件安装过程,所以他们不会假设机器已冻结等。我希望你们能找到足够的信息
。谢谢
@ echo off
REM **************** ************************************************** ***
REM环境定制从这里开始。修改变量
如下。
REM ***************************************** ****************************
REM将DeployServer设置为包含
Office源文件的网络可访问位置。
set DeployServer = \\contoso\c2r\Office365 update\
REM将ConfigFile设置为用于
部署的配置文件(必需)
set ConfigFile = \\contoso\c2r\Office365 update\Customconfig.xml
REM将LogLocation设置为中心目录以收集脚本
日志文件(安装日志文件在XML文件中设置)。
set LogLocation = C:\ AppData \ Local \Temp
REM ***************************************** ****************************
REM部署代码从这里开始。
REM ***************************************** ****************************
REM操作系统是X64。在
模拟的propertyBag注册表项中检查Office365版本
set Key = HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\PropertyBag
for / F" tokens = 3" %% a in('Reg query%Key%/ v Version')
do set Version = %% a
echo version =%Version%
if"%Version%" ==" 15.0.4675.1002"(echo
Office是最新的& goto:eof )
echo%date %% time%安装开始。>>%LogLocation%\%computername%。txt
echo start / wait%DeployServer%\ setup.exe / configure%ConfigFile%
echo%date %% time%安装结束,错误代码%errorlevel%。
>>%LogLocation%\%computername%.txt
I need a vbs of the below script please. It is used to push out office365 updates from the network share. It checks for the installed version and if not found it will run the setup. All of this process is not visible to user so i enable the computer configuration>administrative template>system > script and enabled the run startup script visible option. The issue with this is that i also get the command prompt with the office365 install UI and have read that vbs doesn't show the command execution part and user would only see the software install process so that they do not assume that there machine has frozen etc. I hope you guys will find the information adequate. Thanks
@echo off
REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************
REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\contoso\c2r\Office365 update\
REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\contoso\c2r\Office365 update\Customconfig.xml
REM Set LogLocation to a central directory to collect script log files (install log files are set in XML file).
set LogLocation=C:\AppData\Local\Temp
REM *********************************************************************
REM Deployment code begins here.
REM *********************************************************************
REM Operating system is X64. Check for Office365 version in emulated propertyBag registry key
set Key=HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\PropertyBag
for /F "tokens=3" %%a in ('Reg query %Key% /v Version') do set Version=%%a
echo Version=%Version%
if "%Version%"=="15.0.4675.1002" (echo Office is up-to-date & goto :eof)
echo %date% %time% Setup started. >> %LogLocation%\%computername%.txt
echo start /wait %DeployServer%\setup.exe /configure %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt
这篇关于office365更新批处理文件转换为vbs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!