使用批处理文件挂载.iso文件赢得Windows 8 [英] Mount .iso file win windows 8 with a batch file

查看:81
本文介绍了使用批处理文件挂载.iso文件赢得Windows 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已经备份到iso文件的游戏(笔记本电脑中的磁盘驱动器很吵),并且希望从一个快捷方式运行它,而不必每次都挂载iso文件.我运行Windows 8.1,所以iso文件会本地安装.有什么想法吗?

I have a game which i have backed up to an iso file (the disk drive in my laptop is noisy), and want to run it from a single shortcut without having to mount the iso file every time. I run windows 8.1 so the iso files mount natively. Any ideas?

推荐答案

powershell -Command Mount-DiskImage -ImagePath "C:\winxp.iso" 

请参见 http://technet.microsoft.com/en-us/library/hh848706.aspx

整个脚本"run.ps1"可能看起来像这样:

And the entire script "run.ps1" could look like this:

mount-diskimage -imagepath C:\winxp.iso
$d = (get-diskimage C:\winxp.iso | Get-Volume).DriveLetter
$d = $d + ":\setup.exe"
start-process "$d" -wait 
dismount-diskimage -imagepath C:\winxp.iso

  1. 行-安装图像(如果路径中有空格,请使用")
  2. line-获取分配给iso的驱动器号
  3. line-从iso构造执行命令
  4. 行-执行命令并等待其完成
  5. line-卸载iso

它是powershell脚本,因此您需要从上下文菜单或cmd中以

it's powershell script so you need to run it from context menu or from cmd as

powershell C:\...\run.ps1

如果它说明系统限制,则需要运行powershell和命令

if it says something about system restriction you need to run powershell and the command

set-executionpolicy unrestricted

这篇关于使用批处理文件挂载.iso文件赢得Windows 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆