Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: batch close after powershell script  (Read 12054 times)

0 Members and 1 Guest are viewing this topic.

FMartel

    Topic Starter


    Newbie

    • Experience: Experienced
    • OS: Windows 10
    batch close after powershell script
    « on: February 05, 2020, 10:10:02 AM »
    Hello all, I need some help with this :

    Code: [Select]
    @echo off
    path %path%; c:\windows\temp
    echo ouverture du RDP
    powershell -command "Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0"
    echo installation de boxstarter
    powershell -command "Set-ExecutionPolicy Unrestricted -Force"
    powershell -command ". { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force"
    echo copie du script PowerShell vers le dossier temporaire de Windows
    copy "\\ftp-stg1\FTP Root\Programs\script\vmprog.ps1" C:\Windows\Temp
    echo copie du script CMD vers le dossier temporaire de Windows
    copy "\\ftp-stg1\FTP Root\Programs\script\package_install.cmd" C:\Windows\Temp
    echo appel du script d installation
    call package_install.cmd
    exit

    the scrip closes after this command
    Code: [Select]
    powershell -command ". { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force"the powershell process need to be closed, in order to run this other part of the script
    Code: [Select]
    echo debut de l'installation des programmes avec choco
    powershell -command "Install-BoxstarterPackage -PackageName "C:\Windows\Temp\vmprog.ps1""
    whitch is in package_install.cmd.

    If possible, I'd like to run all the commands in one single batch...
    Let me know if I'm making sens...