乐趣区

关于windows10:Windows10调用powershell运行bat

加粗局部为调用 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
)

退出移动版