最近改InstallAnyWhere脚本,其提供的action中可以调用系统的command或script,windows下就是CMD命令和BAT,有些实用命令记录一下。
创建用户test,密码为password:
net user test password /ADD
删除用户test:
net user test /delete
授权用户对某目录d:\Program Files\Applian的访问权限(full access):
cacls "d:\Program Files\Applian" /t /e /g test:f
windows command-line 命令授权账户的权限为Log On As A Service,
ntrights.exe +r SeServiceLogonRight -u domain\accountname
Granting SeServiceLogonRight to domain\accountname ... successful
如果在CMD运行遇到以下错误,关闭wiNdows UAC功能或让CMD运行在admin用户下(run as admin)
Granting SeServiceLogonRight to domain\accountname OpenPolicy:
***Error*** OpenPolicy -1073741790
ntrights命令需要单独从微软网站下载,属于Resource Kit Tools包,主要功能就是给service授权,能授权的功能如下,该命令运行需要administrator权限:
SeAssignPrimaryTokenPrivilege: Replace a process level token SeAuditPrivilege: Generate security audits SeBackupPrivilege: Back up files and directories SeBatchLogonRight: Log on as a batch job SeChangeNotifyPrivilege: Bypass traverse checking SeCreatePagefilePrivilege: Create a paging file SeCreatePermanentPrivilege: Create permanent shared objects SeCreateTokenPrivilege: Create a token object SeDebugPrivilege: Debug programs SeIncreaseBasePriorityPrivilege: Increase scheduling priority SeIncreaseQuotaPrivilege: Increase quotas SeInteractiveLogonRight: Log on locally SeLoadDriverPrivilege: Load and unload device drivers SeLockMemoryPrivilege: Lock pages in memory SeMachineAccountPrivilege: Add workstations to domain SeNetworkLogonRight: Access this computer from the network SeProfileSingleProcessPrivilege: Profile single process SeRemoteShutdownPrivilege: Force shutdown from a remote system SeRestorePrivilege: Restore files and directories SeSecurityPrivilege: Manage auditing and security log SeServiceLogonRight: Log on as a service SeShutdownPrivilege: Shut down the system SeSystemEnvironmentPrivilege: Modify firmware environment values SeSystemProfilePrivilege: Profile system performance SeSystemTimePrivilege: Change the system time SeTakeOwnershipPrivilege: Take ownership of files or other objects SeTcbPrivilege: Act as part of the operating system SeUnsolicitedInputPrivilege: Read unsolicited input from a terminal device
用管理员权限运行某些命令的方式为:
runas /user:administrator cmd.exe
相当于windows版的sudo,运行后需要手工输入管理员密码。
本文出自 “祝坤荣” 博客,请务必保留此出处
相关推荐
仅收录该书籍以供学习和讨论 包含pdf书籍及经过验证的示例 执行demo中的示例方式 在编译环境下进入demo目录,执行nmake命令在bin目录下生成可执行文件 注:demo无注释,对应书本中部分示例。 目录 第1章 Windows...
要禁止它们显示提示并不是将它们一一改为空的内容或删除InfoTip,打开注册表到HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced,将右边ShowInfoTip 的值由1 改为0,重新启动计算机...
15.4.1 Windows Installer Service 472 15.4.2 msi文件的创建与修改工具orca.exe 474 15.4.3 准备工作 475 15.4.4 编辑表组 475 第16章 设备驱动管理与内核通信 476 16.1 设备管理 476 16.1.1 列举...
验证是否已将“DTC 登录帐户”名称设置为 NT AUTHORITY\NetworkService。 [顶部] 3.6 默认情况下不安装示例数据库 默认情况下,不在 SQL Server Express 中安装示例数据库。Northwind 和 pubs 示例数据库可以从 ...
如果不能在启动目录(默认为 %systemroot%System32)中找到该文件,将试着在 Windows 安装 CD 中找到它。如果有多引导系统的计算机,必须保证是在包含 Windows 的驱动器上使用该命令。 Diskpart 创建和删除硬盘...
当设定为[Enabled](启动)时,将会有15M-16M的内存空间预留给特别需要此设定的ISA扩充卡。这会使得内存有15 MB以上的空间无法让系统使用,这个项目请使用系统的默认值。 Delay Prior to Thermal(激活延时设置):...
5当mongod.exe被关闭时,mongo.exe 就无法连接到数据库了,因此每次想使用mongodb数据库都要开启mongod.exe程序,所以比较麻烦,此时我们可以将MongoDB安装为windows服务 cmd跳转到mongodb下的bin目录下输入 mongod ...
您还需要安装并配置一个bash shell-OSX和linux上的默认bash shell或Windows上的 。 安装 # Using NPM: npm i create-pwa --save-dev # Using Yarn yarn add create-pwa --dev 争论 icon :指定应用程序图标的相对...
这一联盟将会支持 Google 发布的 Android 手机操作系统或者应用软件,共同开发名为 Android 的 开 放源代码的移动系统。开放手机联盟包括手机制造商、手机芯片厂商和移动运营商几类。目前,联盟成员 数 量已经达到了...
12.5.4 创建Service 12.5.5 配置存储集群GFS 12.5.6 配置表决磁盘 12.5.7 配置Fence设备 12.6 管理和维护RHCS集群 12.6.1 启动RHCS集群 12.6.2 关闭RHCS集群 12.6.3 管理应用服务 12.6.4 监控RHCS...