关于windows10:Windows10调用powershell运行bat

46次阅读

共计 678 个字符,预计需要花费 2 分钟才能阅读完成。

加粗局部为调用 powershell 代码

————————————

@echo off

pushd %~dp0
powershell.exe -command ^
“& {set-executionpolicy Remotesigned -Scope Process; .’.\ClearIISLogFiles.ps1′}”

cd..
set SCRIPTPATH=%cd%

: top src directory
set leanotePath=”%SCRIPTPATH%\bin\src\github.com\leanote”

if not exist “%leanotePath%” mkdir “%leanotePath%”

: create software link
if exist “%leanotePath%\leanote” del /Q “%leanotePath%\leanote”
mklink /D “%leanotePath%\leanote”  %SCRIPTPATH%

: set GOPATH
set GOPATH=”%SCRIPTPATH%\bin”

: run
if %processor_architecture%==x86 (
    “%SCRIPTPATH%\bin\leanote-windows-386.exe” -importPath github.com/leanote/leanote
) else (
    “%SCRIPTPATH%\bin\leanote-windows-amd64.exe” -importPath github.com/leanote/leanote
)

正文完
 0