cmd使用管理员权限运行,启动路径不是当前目录
https://stackoverflow.com/questions/672693/windows-batch-file-starting-directory-when-run-as-admin
Better than cd is pushd which will
- change drive letter if starting from
D:\... - assign a drive letter if on a UNC network path
So pushd %~dp0 is good.
Good practice is then to call popd when done.
https://ss64.com/nt/pushd.html
Run as Admin
When a batch script is 'Run as Admin', the current directory will be set to C:\windows\system32\.
Using the following pushd command at the start of the script will restore the normal current directory.
This works by setting the current directory to the location of the batch script, using the %0 parameter
pushd "%~dp0"
cmd使用管理员权限运行,启动路径不是当前目录的更多相关文章
- 如何设置默认以管理员权限运行cmd
设置cmd以管理员权限运行 目的:创建或删除文件等命令时,需要管理员权限运行cmd(linux以root用户登录). 例如,创建日志目录. 方法一: 1.激活administrator用户 2 ...
- RobotFramework环境配置:默认以管理员权限运行cmd
设置cmd以管理员权限运行 目的:创建或删除文件等命令时,需要管理员权限运行cmd(linux以root用户登录). 例如,创建日志目录. 方法一: 1.激活administrator用户 2 ...
- bat代码中判断 bat是否是以管理员权限运行,以及自动以管理员权限运行CMD BAT
· bat 代码中判断bat是否是以管理员权限运行,以及自动以管理员权限运行CMD BAT 一.判断bat是否是以管理员权限运行 @echo off net.exe session >NUL & ...
- 如何在程序里模拟在cmd里用管理员权限运行一条指令
转自csdn的yangw150,zhao4zhong1 转自http://www.cnblogs.com/del/archive/2008/02/13/1068229.html http://blog ...
- WIN10使用管理员权限运行VS2013
学习WCF时出现报错-- 其他信息: HTTP 无法注册 URL http://+:8083/User/.进程不具有此命名空间的访问权限(有关详细信息,请参见 http://go.microsoft. ...
- EasyNVR摄像机H5流媒体服务器在windows上批处理脚本自动以管理员权限运行
很多时候, 我们需要以管理员权限来运行批处理脚本, 比如操作 windows 服务. EasyNVR 中提供安装服务的批处理脚本, 运行这个bat文件, 自动将 EasyNVR 以 windows 服 ...
- C# 使用管理员权限运行程序
最近在开发OPCServer组件过程中,在注册opcServer是总是返回false,后来查找原因得知在本地主机注册opcServer时,需要使用管理员权限. OPCServer在一台机器上部署时只需 ...
- C#启用管理员权限运行程序
方法一:关闭程序重新请求打开 static class Program { [STAThread] static void Main() { Application.EnableVisualStyle ...
- C#程序以管理员权限运行
原文:C#程序以管理员权限运行 C#程序以管理员权限运行 在Vista 和 Windows 7 及更新版本的操作系统,增加了 UAC(用户账户控制) 的安全机制,如果 UAC 被打开,用户即使以管理员 ...
随机推荐
- java字符串转换总结
1.byte[]转String String str = new String(strByte); 2.String转byte[] byte[] byteArr = str.getBytes(); 3 ...
- Python基础知识摘要
python字典 增,删,改,查 1.增:XXX[新的key] = value 2.删:DEL XXX[key] 3.改:XXX[已经存在的key] = NewValue 4.查:aList.exte ...
- SQL 中的连接查询
关于SQL的应用,肯定离不开查询,而相对复杂的查询,总是离不开对表的连接,单个表操作的并不罕见,但是在应用环境大多数的查询都是针对2.3个表甚至更多的表7,至于连接,有内连接.外链接.交叉连接之分,每 ...
- 【Redis学习之十一】Java客户端实现redis集群操作
客户端:jedis-2.7.2.jar 配置文件两种方式: properties: redis.cluster.nodes1=192.168.1.117 redis.cluster.port1=700 ...
- modelsim仿真正确FPGA运行不正确的可能原因 - cm4写寄存器错
困住整整一周了,工作进行不下去,中午偶遇导师,指导意见是有两种可能: 1. FPGA编译器优化代码,可以考虑把综合过程中所有的warning排查一下 2. verilog里有不可综合的语句. 又及 ...
- 设置Source Insight显示格式
调整字体大小 默认的忍不了,百度之,解决方案如下:1.Document Options -> Screen Fonts -> 字体设置为新宋体(等宽)或者其他支持中文的字体,字符集选GB2 ...
- [protocol]GO enrichment analysis
[protocol]GO enrichment analysis 背景: 什么是富集分析,自己可以百度.我到目前也没发现一个比较通俗易懂的介绍.直接理解为一种统计学方法就可以了. 用于查看显著 ...
- java.security.NoSuchAlgorithmException: AES KeyGenerator not available
异常信息 Caused by: Java.lang.IllegalStateException: Unable to acquire AES algorithm. This is required t ...
- python pandas 基础理解
其实每一篇博客我都要用很多琐碎的时间片段来学完写完,每次一点点,用到了就学一点,学一点就记录一点,要用上好几天甚至一两个礼拜才感觉某一小类的知识结构学的差不多了. Pandas 是基于 NumPy 的 ...
- Android开源图表图形库K线图
Android开源图表图形库K线图 web端k线图一般使用TradingView,android原生的一般是在MPAndroidChart 基础上做开发的,目前看到一个比较好的K线开源组件是KChar ...