This batch script is used to install, update, configure, and...

July 3, 2025 at 05:09 AM

@echo off REM BFCPEOPTIONSTART REM Advanced BAT to EXE Converter www.BatToExeConverter.com REM BFCPEEXE=M:\BILDER\_picasa\Script\Versionen\V240\Picasa_Start.exe REM BFCPEICON=M:\BILDER\_picasa\Script\Versionen\V240\Picasa_Start.ico REM BFCPEICONINDEX=1 REM BFCPEEMBEDDISPLAY=0 REM BFCPEEMBEDDELETE=1 REM BFCPEADMINEXE=0 REM BFCPEINVISEXE=0 REM BFCPEVERINCLUDE=0 REM BFCPEVERVERSION=1.0.0.0 REM BFCPEVERPRODUCT=Product Name REM BFCPEVERDESC=Product Description REM BFCPEVERCOMPANY=Your Company REM BFCPEVERCOPYRIGHT=Copyright Info REM BFCPEWINDOWCENTER=0 REM BFCPEDISABLEQE=0 REM BFCPEWINDOWHEIGHT=15 REM BFCPEWINDOWWIDTH=80 REM BFCPEWTITLE=PICASA - Bildverwaltung REM BFCPEOPTIONEND chcp 1252 > nul setlocal title PICASA - Bildverwaltung REM ==================================================================== REM PICASA / Start- und Installationsskript / V2.40 REM 30.05.07 - 02.02.25, Martin Herbig, NHF REM -------------------------------------------------------------------- REM Picasa wird installiert bzw. aktualisiert, Picasa-Datenbanken werden REM ausgetauscht und die Anwendung im Netz oder lokal gestartet. REM Compiliert mit "www.battoexeconverter.com / V4.61" REM ==================================================================== REM Systemvariablen REM --------------- REM %USERNAME% - z.B. herbig REM %USERPROFILE% - z.B. C:\Users\herbig REM %WINDIR% - z.B. C:\Windows REM C:\Users\... => Pfade und Robocopy V027 für Windows Vista, Windows 7, Windows 10 REM Ansonsten... => Pfade und Robocopy V010 für Windows XP, Windows Vista und Windows 7 if exist C:\Users\nul ( REM Wo werden die Links abgelegt? set "AnwDaten=%USERPROFILE%\AppData\Local\Google" ver |find /i "Microsoft Windows [Version 10" > NUL if not ERRORLEVEL 1 ( set LnkDaten=P:\Desktop ) else ( set LnkDaten=%USERPROFILE%\Desktop ) REM Weitere Variablen set "PrgDaten=C:\ZEAG\Picasa" if exist C:\Windows\SysWOW64\robocopy.exe ( set robo=C:\Windows\SysWOW64\robocopy.exe ) else ( set robo=C:\Windows\system32\robocopy.exe ) set "para=/MT:8 /DST /R:0 /W:0 /NP /NFL /NDL" ) else ( set "AnwDaten=%USERPROFILE%\Lokale Einstellungen\Anwendungsdaten\Google" set "LnkDaten=%AppData%\Microsoft\Internet Explorer\Quick Launch" set "PrgDaten=%ProgramFiles%\Picasa3" set "robo=M:\Bilder\_picasa\Tools\robocopy.exe" set "para=/R:0 /W:0 /NP /NFL /NDL" ) set "InsDaten=M:\Bilder\_picasa" set "VerPaktu=V3.9" set "VerPtest=V3.9" set "VerScrip=V2.40" set StartText=A c h t u n g if #%1#==#start# set StartText=S t a r t if #%1#==#test# set StartText=T e s t if #%1#==#update# set StartText=U p d a t e if #%1#==#backup# set StartText=D a t e n i n d e x s i c h e r n if #%1#==#index# set StartText=D a t e n i n d e x h o l e n if #%1#==#install# set StartText=I n s t a l l a t i o n if #%1#==#uninstall# set StartText=D e i n s t a l l a t i o n REM Startmeldung ausgeben REM --------------------- echo ------------------------------------------------------------------------------- echo P I C A S A %VerPaktu% - %StartText% - M. Herbig, NP, %VerScrip% echo ------------------------------------------------------------------------------- echo. REM Picasa wird mit unterschiedlichen Parametern gestartet REM ------------------------------------------------------ if #%1#==#start# goto :Picasa_Start if #%1#==#test# goto :Picasa_Test if #%1#==#update# goto :Picasa_Update if #%1#==#backup# goto :Picasa_Backup if #%1#==#index# goto :Picasa_Index if #%1#==#install# goto :Picasa_Install if #%1#==#uninstall# goto :Picasa_Uninstall REM Abbruch wegen fehlenden oder ungültigen Parameters REM -------------------------------------------------- echo Das Skript wurde ohne gültigen Paramter gestartet. Picasa bitte zuerst im echo. echo 'Application Launcher' installieren und dann über das Desktop-Icon starten. ping -n 5 localhost > nul goto :eof REM PICASA STARTEN (geschieht immer mit dem lokalen Picasa_Start.exe, REM damit dieses auch in der Superbar fixiert werden kann und damit REM Manipulationen am Startscript ausgeschlossen sind. REM ----------------------------------------------------------------- :Picasa_Start :: Prüfen, ob das Start-Tool noch aktuell ist und ggf. aktualisieren fc "%PrgDaten%\Picasa_Start.exe" "%InsDaten%\Script\Picasa_Start.exe" > nul if #%errorlevel%#==#0# ( goto :Picasa_Install_Software ) else ( start /B %InsDaten%\Script\Picasa_Start.exe update goto :eof ) REM Das Picasa-Starttool wird aktualisiert und Picasa gestartet REM ----------------------------------------------------------------- :Picasa_Update ping -n 1 localhost > nul goto :Picasa_Install_Software REM Lokale Konfiguration als Standard sichern REM ----------------------------------------- :Picasa_Backup echo Die lokale Konfiguration wird als Netz-Standard gesichert. echo. echo [Fenster schliessen = Abbruch] echo. pause if not exist "%AnwDaten%\Picasa2\DB3\thumbindex.db" goto :Picasa_Backup_Ende if not exist "%AnwDaten%\Picasa2Albums\watchedfolders.txt" goto :Picasa_Backup_Ende %robo% "%AnwDaten%\Picasa2" "%InsDaten%\Konfiguration\Picasa2" /MIR %para% %robo% "%AnwDaten%\Picasa2Albums" "%InsDaten%\Konfiguration\Picasa2Albums" /MIR %para% echo. echo Der Sicherungsvorgang wurde erfolgreich beendet. echo. pause goto :eof :Picasa_Backup_Ende echo. echo Es sind keine lokalen Konfigurationen vorhanden. echo. echo Der Sicherungsvorgang wird abgebrochen. echo. pause goto :eof REM Picasa neu indizieren REM --------------------- :Picasa_Index echo Die lokale Konfiguration wird durch den Netz-Standard ueberschrieben. Dabei echo. echo gehen eventuell bereits angelegte Fotoalben verloren. Die Bilder selbst echo. echo bleiben natuerlich erhalten. echo. echo [Fenster schliessen = Abbruch] echo. pause if exist "%AnwDaten%\Picasa2\DB3\thumbindex.db" del "%AnwDaten%\Picasa2\DB3\thumbindex.db" if exist "%AnwDaten%\Picasa2Albums\watchedfolders.txt" del "%AnwDaten%\Picasa2Albums\watchedfolders.txt" goto :Picasa_Install_Daten REM Neue Picasa-Version testen REM -------------------------- :Picasa_Test echo Die Picasa-Version %VerPtest% wird testweise installiert und gestartet. echo. echo [Fenster schliessen = Abbruch] echo. pause %robo% "%InsDaten%\Picasa3.test" "%PrgDaten%" /MIR %para% goto :Picasa_Install_Daten REM Picasa deinstallieren REM --------------------- :Picasa_Uninstall echo Picasa wird deinstalliert. echo. echo [Fenster schliessen = Abbruch] echo. pause :: U.U. Prozess beenden taskkill /F /IM picasa3.exe echo. if exist %PrgDaten%\nul ( rd /s /q "%PrgDaten%" rd /s /q "%AnwDaten%" del /q "%LnkDaten%\Picasa*.lnk" ) echo Picasa wurde deinstalliert. ping -n 5 localhost > nul goto :eof REM Picasa installieren/aktualisieren REM --------------------------------- :Picasa_Install echo Picasa wird installiert/aktualisiert (Software und ggf. Datenbanken). echo. echo [Fenster schliessen = Abbruch] echo. pause :: Picasa-Software installieren/aktualisieren :Picasa_Install_Software %robo% "%InsDaten%\Picasa3.inst" "%PrgDaten%" /XF "%PrgDaten%\Picasa_Start.exe" /MIR %para% :: Datenbanken kopieren wenn (noch) nicht vorhanden oder wenn erzwungen (Index holen) :Picasa_Install_Daten if exist "%AnwDaten%\Picasa2\DB3\thumbindex.db" goto :Picasa_Install_Watch %robo% "%InsDaten%\Konfiguration\Picasa2" "%AnwDaten%\Picasa2" /MIR %para% :: Watchlist kopieren wenn gesichert aber lokal (noch) nicht vorhanden :Picasa_Install_Watch if exist "%AnwDaten%\Picasa2Albums\watchedfolders.txt" goto :Picasa_Install_Rest %robo% "%InsDaten%\Konfiguration\Picasa2Albums" "%AnwDaten%\Picasa2Albums" /MIR %para% :: Bei Bedarf Starttool und Links installieren/aktualiseren :Picasa_Install_Rest if #%1#==#start# goto :Picasa_Go if #%1#==#test# ( ::Picasa-Starttool installieren/aktualisieren copy /y "%InsDaten%\Script\Picasa_Start.exe" "%PrgDaten%\Picasa_Start.exe" > nul goto :Picasa_Go ) if #%1#==#update# ( ::Picasa-Starttool installieren/aktualisieren copy /y "%InsDaten%\Script\Picasa_Start.exe" "%PrgDaten%\Picasa_Start.exe" > nul goto :Picasa_Go ) if #%1#==#index# ( echo Die Netz-Konfiguration wurde erfolgreich installiert. echo. ping -n 5 localhost > nul goto :eof ) if #%1#==#install# ( ::Picasa-Starttool installieren/aktualisieren copy /y "%InsDaten%\Script\Picasa_Start.exe" "%PrgDaten%\Picasa_Start.exe" > nul ::Links installieren/aktualisieren (alte löschen) if exist "%LnkDaten%\Picasa.lnk" del "%LnkDaten%\Picasa.lnk" if exist "%LnkDaten%\Picasa2.lnk" del "%LnkDaten%\Picasa2.lnk" if exist "%LnkDaten%\Picasa3.lnk" del "%LnkDaten%\Picasa3.lnk" if exist "%LnkDaten%\PICASA 3 ~ Start.lnk" del "%LnkDaten%\PICASA 3 ~ Start.lnk" if exist "%LnkDaten%\PICASA ~ Start.lnk" del "%LnkDaten%\PICASA ~ Start.lnk" copy /y "%InsDaten%\PICASA ~ Start.lnk" "%LnkDaten%\PICASA ~ Start.lnk" > nul echo. echo Picasa wurde erfolgreich installiert. echo. ping -n 5 localhost > nul goto :eof ) REM Picasa starten REM -------------- :Picasa_Go :: Windows-Version for /f "tokens=4-5 delims=. " %%i in ('ver') do set version=%%i.%%j ::Windows 11 if "%version%" == "11.0" set dword=11001 ::Windows 10 if "%version%" == "10.0" set dword=11001 ::Windows 8.1 if "%version%" == "6.3" set dword=11000 ::Windows 8.0 if "%version%" == "6.2" set dword=11000 ::Windows 7.0 if "%version%" == "6.1" set dword=11000 ::Windows Vista if "%version%" == "6.0" set dword=11000 :: GoogleMaps-Anzeige sichtbar schalten reg add "HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\Feature_Browser_Emulation" /v picasa3.exe /t REG_DWORD /d %dword% /f > nul :: Start fortsetzen if #%1#==#test# ( echo. echo Die aktuelle Picasa-Testversion %VerPtest% wird nun gestartet. echo. ping -n 2 localhost > nul ) else ( echo. echo Die aktuelle Picasa-Version %VerPaktu% wird nun gestartet. echo. ping -n 2 localhost > nul ) start /B %PrgDaten%\Picasa3.exe

This batch script is used to install, update, configure, and manage the Picasa program along with its associated data, such as databases and configuration files. It is tailored for both local and network scenarios with specific instructions for updating the Picasa software, managing its configurations, and handling various commands.

Key Highlights of the Code:

  1. Batch Script for Automation:

    • It is a Windows batch script designed for deployment and maintenance of Google's Picasa software.
  2. Command Line Parameters:

    • The script executes specific actions based on the parameters passed when it is run. For example:
      • start - Starts the Picasa application.
      • test - Installs and tests the Picasa software.
      • update - Updates the application and start tool.
      • backup - Backs up local configuration files.
      • index - Recreates the index database and updates configuration.
      • install - Installs or reinstalls Picasa, including related configuration files and links.
      • uninstall - Removes Picasa and cleans up associated files.
  3. Variable Initializations:

    • The script initializes a variety of system paths and application-related variables like %AnwDaten% (application data folder), %LnkDaten% (link folder for shortcuts), and %PrgDaten% (program folder).
  4. Dynamic Adaptation:

    • The script detects the user environment (e.g., Windows version, architecture) and adjusts file paths and tools.
    • For example:
      • Check for the presence of the SysWOW64 folder to use the appropriate robocopy tool.
      • Compatibility adjustments for different versions of Windows (XP, 7, 10).
  5. Software Update and Installation:

    • Functions to compare the current executable (e.g., Picasa_Start.exe) and update it if required.
    • Uses robocopy to sync data and install software/configuration:
      • Ensures data integrity during backup and restoration.
      • Handles copying of watched folders and database files.
  6. Picasa Functionality:

    • Integrates with Picasa's configuration (e.g., Google Maps browser emulation handled via registry changes to HKCU).
    • Starts Picasa3.exe after handling updates, backups, or installations.
  7. Error Handling:

    • Displays errors if no valid parameter is provided.
    • Waits for user confirmation for potentially destructive operations like reinstalls or deletions.

Workflow:

  • Initialize Configuration: Based on the Windows version and user environment, system paths and variables are configured.
  • Determine Action: Based on the input parameter (e.g., start, install, update), it invokes the corresponding label or function.
  • Perform Action: Functions like updating, starting, or uninstalling Picasa are executed. Each action involves robust checks to ensure smooth execution, like verifying file existence, permissions, and prompting users for confirmation where needed.
  • Exit: Ends with a goto :eof to ensure proper script termination.

Practical Use Case:

This script can be used by administrators or IT experts to deploy and manage Picasa across multiple machines in an automated way, ensuring all configurations and databases are synchronized and the application remains updated.

Generate your own explanations
Download our vscode extension
Read other generated explanations

Built by @thebuilderjr
Sponsored by beam analytics
Read our terms and privacy policy
Forked from openai-quickstart-node