1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

バッチ1

Posted at
@echo off

REM MSIのインストール
msiexec /i "path_to_your_installer.msi" /qn /norestart

REM レジストリからインストール先のパスを取得する例
for /f "tokens=3*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{YourAppGUID}" /v "InstallLocation" 2^>nul') do (
    SET "INSTALL_PATH=%%B"
)

REM インストール先にファイルをコピーする前に、ファイルが存在するか確認
IF EXIST "%INSTALL_PATH%" (
    REM コピー元とコピー先のファイルパスを指定してコピーを行う
    copy "source_file_path" "%INSTALL_PATH%\destination_file_name"
    REM 別のファイルをコピーする場合は、上記の行を追加する
) ELSE (
    echo Installation directory not found.
)

exit
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?