Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 此powershell命令的bat版本是什么?sccm中的安装行将使用什么命令?_Windows_Powershell_Batch File_Powershell 4.0_Sccm - Fatal编程技术网

Windows 此powershell命令的bat版本是什么?sccm中的安装行将使用什么命令?

Windows 此powershell命令的bat版本是什么?sccm中的安装行将使用什么命令?,windows,powershell,batch-file,powershell-4.0,sccm,Windows,Powershell,Batch File,Powershell 4.0,Sccm,下面是我在powershell中启动应用程序时使用的命令,我特意使用了*通配符,因为每个设备的应用程序文件夹名称略有变化。我想复制bat文件中的通配符 Start-Process -FilePath "C:\ProgramData\theapp*\theapp.exe" 因此,对于bat文件版本,我可以使用: start "C:\ProgramData\theapp*" theapp.exe 此外,如果可以使用:在sccm中,哪种安装线最适合启动此功

下面是我在powershell中启动应用程序时使用的命令,我特意使用了*通配符,因为每个设备的应用程序文件夹名称略有变化。我想复制bat文件中的通配符

Start-Process -FilePath "C:\ProgramData\theapp*\theapp.exe" 
因此,对于bat文件版本,我可以使用:

start "C:\ProgramData\theapp*" theapp.exe
此外,如果可以使用:在sccm中,哪种安装线最适合启动此功能


非常感谢

您的bat文件版本不正确,您不仅创建了“标题”,而且通配符在cmd.exe中的工作方式与此不同。您应该通过打开命令提示窗口,键入
start/?
,然后按
[ENTER]
查看
启动
命令的用法信息,然后在(“C:\ProgramData\theapp*”)中按/d%I。执行“%~I\theapp.exe”感谢@rojo和@Squashman。我假设SCCM安装命令将遵循cmd控制台语法,而不是.bat文件语法。当问题表明用户将使用
批处理文件时,为什么给用户提供
for
命令的命令行语法@如果您不知道,.bat文件要求
循环迭代变量的
百分比加倍。换句话说,如果要将该行放入.bat脚本,请将
%I
%I
更改为
%I
%I