Author: skate
Time: 2013/12/20
Function: create a user on win2003 and initialize the desktop of the new user
Echo [InternetShortcut]> MysqlTool. url
Echo URL = C: \ Program Files \ HeidiSQL \ heidisql.exe> MysqlTool. url
Echo IconIndex = 0> MysqlTool. url
Echo IconFile = C: \ Program Files \ HeidiSQL \ heidisql.exe> MysqlTool. url
The file content is as follows:
[InternetShortcut]
URL = C: \ Program Files \ HeidiSQL \ heidisql.exe
IconIndex = 0
IconFile = C: \ Program Files \ HeidiSQL \ heidisql.exe
Then, store the created shortcut file "Mysql Tool" in the following directory (win2003)
C: \ Documents ents and Settings \ Default User \ Desktop \
Or directly create a shortcut
Echo [InternetShortcut]> "C: \ Documents ents and Settings \ Default User \ Desktop \ MysqlTool. url"
Echo URL = C: \ Program Files \ HeidiSQL \ heidisql.exe> "C: \ Documents and Settings \ Default User \ Desktop \ MysqlTool. url"
Echo IconIndex = 0> "C: \ Documents ents and Settings \ Default User \ Desktop \ MysqlTool. url"
Echo IconFile = C: \ Program Files \ HeidiSQL \ heidisql.exe> "C: \ Documents ents and Settings \ Default User \ Desktop \ MysqlTool. url"
Then write the User Creation script adduser. bat. The content is as follows:
@ Echo off
Set/p username = enter the added User Name:
Set/p isuserdel = whether to delete user Y/N if the user exists:
Echo % username %
Net user % username %> nul 2> nul
If "% errorlevel %" = "0 "(
Echo exists for this user
If "% isuserdel %" = "Y "(
Net user % username %/del
Echo user "% username % deleted"
)
) Else (
Echo user does not exist. Creating ....
Net user % username % 111111/add
Net localgroup "Remote Desktop Users" % username %/add
Echo user has been created successfully
)
Echo press any key to exit
Pause & exit
--- End ---