Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Windows Server系統教程 >> Windows Server常見問題解答 >> cmd命令創建系統用戶並初始化新用戶桌面

cmd命令創建系統用戶並初始化新用戶桌面

日期:2017/1/20 17:24:20      編輯:Windows Server常見問題解答
am Files\HeidiSQL\heidisql.exe >> MysqlTool.url

文件內容如下:

[InternetShortcut]
URL=C:\Program Files\HeidiSQL\heidisql.exe
IconIndex=0
IconFile=C:\Program Files\HeidiSQL\heidisql.exe


然後把創建的快捷方式文件“Mysql Tool”,放在如下的目錄下(win2003)
C:\Documents and Settings\Default User\桌面\


或者直接創建快捷方式

echo [InternetShortcut] >> "C:\Documents and Settings\Default User\桌面\MysqlTool.url"
echo URL=C:\Program Files\HeidiSQL\heidisql.exe >> "C:\Documents and Settings\Default User\桌面\MysqlTool.url"
echo IconIndex=0 >> "C:\Documents and Settings\Default User\桌面\MysqlTool.url"
echo IconFile=C:\Program Files\HeidiSQL\heidisql.exe >> "C:\Documents and Settings\Default User\桌面\MysqlTool.url"

然後編寫創建用戶腳本adduser.bat, 內容如下

@echo off
set /p username=輸入添加的用戶名:
set /p isuserdel=如果用戶存在,是否刪除用戶Y/N:
echo %username%
net user %username% >nul 2>nul

if "%errorlevel%" == "0" (
echo 存在該用戶
if "%isuserdel%" == "Y" (
net user %username% /del
echo 用戶 "%username% 已經刪除"
)
) else (
echo 用戶不存在,正在創建....
net user %username% 111111 /add
net localgroup "Remote Desktop Users" %username% /add
echo 用戶已經成功創建
)
echo 按任意鍵退出
pause & exit 

---end---

Copyright © Windows教程網 All Rights Reserved