한 번만 실행하면 Wi-Fi 자동 연결 설정이 완료되는 PowerShell 스크립트
페이지 정보
본문
# 사용자 입력
$ssid = Read-Host "자동 연결할 Wi-Fi SSID 입력"
$password = Read-Host "Wi-Fi 비밀번호 입력" -AsSecureString
# 비밀번호 평문 변환
$plainPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
[Runtime.InteropServices.Marshal]::SecureStringToBSTR($password)
)
# XML Wi-Fi 프로파일 생성
$xml = @"
<?xml version="1.0"?>
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
<name>$ssid</name>
<SSIDConfig>
<SSID>
<name>$ssid</name>
</SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<connectionMode>auto</connectionMode>
<MSM>
<security>
<authEncryption>
<authentication>WPA2PSK</authentication>
<encryption>AES</encryption>
<useOneX>false</useOneX>
</authEncryption>
<sharedKey>
<keyType>passPhrase</keyType>
<protected>false</protected>
<keyMaterial>$plainPassword</keyMaterial>
</sharedKey>
</security>
</MSM>
<MacRandomization xmlns="http://www.microsoft.com/networking/WLAN/profile/v3">
<enableRandomization>false</enableRandomization>
</MacRandomization>
</WLANProfile>
"@
# 임시 파일 경로
$tempFile = "$env:TEMP\$ssid.xml"
$xml | Out-File -Encoding UTF8 -FilePath $tempFile
# 프로파일 추가
netsh wlan add profile filename="$tempFile" user
첨부파일
-
Setup-AutoWiFi.ps1 (1.4K)
0회 다운로드 | DATE : 2025-04-23 11:33:28
- 이전글트레이에서 마우스(여러개일때) 자동선택 25.04.30
- 다음글한 번만 실행하면 Wi-Fi 자동 연결 설정이 완료되는 배치 파일 25.04.23
댓글목록
등록된 댓글이 없습니다.