Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- REM Script to update MPAM signature files on Windows 7
- REM Deletes existing mpam-fe.exe from local save location
- REM Copies appropriate architecture version from network share
- REM Executes the update
- echo Starting MPAM signature update process...
- echo.
- REM Step 1: Check if [local directory] exists, create if not
- if not exist "[local directory]" (
- echo Creating [local directory] directory...
- mkdir "[local directory]"
- if errorlevel 1 (
- echo ERROR: Failed to create [local directory] directory
- pause
- exit /b 1
- )
- )
- REM Step 2: Delete existing mpam-fe.exe if it exists
- if exist "[lcoal directory]mpam-fe.exe" (
- echo Deleting existing mpam-fe.exe from [local ldirectory]...
- del "[local directory]mpam-fe.exe"
- if errorlevel 1 (
- echo ERROR: Failed to delete existing mpam-fe.exe
- pause
- exit /b 1
- )
- echo Existing file deleted successfully.
- ) else (
- echo No existing mpam-fe.exe found in [local directory]
- )
- REM Step 3: Determine system architecture
- echo Detecting system architecture...
- set "ARCH="
- REM Check if we're running on 64-bit system
- if exist "%ProgramFiles(x86)%" (
- set "ARCH=x64"
- set "SOURCE_PATH=[network path to get update from]"
- echo Detected 64-bit system
- ) else (
- set "ARCH=x86"
- set "SOURCE_PATH=[network path to get update from]"
- echo Detected 32-bit system
- )
- echo Architecture: %ARCH%
- echo Source path: %SOURCE_PATH%
- echo.
- REM Step 4: Copy the appropriate mpam-fe.exe file
- echo Copying mpam-fe.exe from network share...
- copy "%SOURCE_PATH%mpam-fe.exe" "[local directory]mpam-fe.exe"
- if errorlevel 1 (
- echo ERROR: Failed to copy mpam-fe.exe from %SOURCE_PATH%
- echo Please check:
- echo - Network connectivity
- echo - Access permissions to the share
- echo - File exists at source location
- pause
- exit /b 1
- )
- echo File copied successfully.
- echo.
- REM Step 5: Verify the file was copied
- if not exist "[local directory]mpam-fe.exe" (
- echo ERROR: mpam-fe.exe not found in [local directory] after copy operation
- pause
- exit /b 1
- )
- echo Verifying copied file...
- dir "[local directory]mpam-fe.exe"
- echo.
- REM Step 6: Execute mpam-fe.exe
- echo Executing mpam-fe.exe...
- cd /d "[local directory]"
- mpam-fe.exe
- set "EXEC_RESULT=%errorlevel%"
- echo.
- echo mpam-fe.exe execution completed with exit code: %EXEC_RESULT%
- echo.
- REM Step 7: Information about checking results
- echo ================================================================
- echo To verify the signature update was successful:
- echo 1. Open Event Viewer
- echo 2. Navigate to Windows Logs ^> System
- echo 3. Look for Event ID 2000
- echo 4. Successful update will show: "%%%%860 signature version has been updated."
- echo ================================================================
- echo.
- if %EXEC_RESULT% equ 0 (
- echo Script completed successfully.
- ) else (
- echo Script completed with warnings. Check Event ID 2000 for details.
- )
- echo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement