Powershell script to run a .bat file when a file is added to a folder

前端 未结 2 1736
谎友^
谎友^ 2021-01-20 20:10

I\'d like to monitor a Windows 7 folder and have a .bat file run when any new files are added to the folder. It seems like I should be able to do this using powershell, whic

2条回答
  •  后悔当初
    2021-01-20 20:46

    you can also use this code to run ps1 file in background instead of invoke-item

    Invoke-Expression -Command "C:....\somescript.ps1"

提交回复
热议问题