服务程序中以管理员权限启动其它程序

一招解决“以管理员身份运行cmd显示neo4j.bat 不是内部或外部命令”的问题(1) 第一篇博客献给了neo4j哈哈~话不多说,先解决问题—— 前提是环境变量配置正确,配置教程可以看其他博主,很简单 然后我测试安装的时候发现(这里我已经以管理员身份进入了) 到这里首先检查一下你的环境变量配置是否正确,绝大多数都是这个问题。我之前android studio的gradle和java的jdk都配置过,也算有过经验,而且反复检查了很多遍,最后我排除了环境变量的问题。 我开始怀疑是我的管理员身份没到位,于是乎各种搜索“如何进入管理员cmd”,终于找到一个与众不同的进入方法——WIN 阅读详情


       项目中的实际问题:需要用一个服务程序来启动并监控另一个程序,而该程序中使用了JavaScript,并且访问百度的地图API,启动该程序后,发现地图总是无法加载,   这个问题纠结了我和外部程序的开发者三天时间了,一直没有头绪,今天写了一个最简单的百度地图的加载代码,结果弹出如下提示框

       

       但是当我自己按照普通的方式直接运行这个外部程序的时候,却能够正常加载,因此推断问题可能出现在启动权限上。

 

       检查代码,我的实现代码如下:

      

DWORD INTER_GetExplorerToken(OUT PHANDLE  phExplorerToken )   

{ 
	DWORD       dwStatus = ERROR_FILE_NOT_FOUND ;   
	BOOL        bRet = FALSE ;  
	HANDLE      hProcess = NULL ;  
	HANDLE      hProcessSnap = NULL ;  
	wchar_t        szExplorerPath[MAX_PATH] = { 0 } ;  
	wchar_t        FileName[MAX_PATH] = { 0 } ;  

	PROCESSENTRY32 pe32 = { 0 } ;  

	GetWindowsDirectory( szExplorerPath , MAX_PATH ) ;
	StrCatW( szExplorerPath , L"\\Explorer.EXE" ) ;   
	hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS , 0 ) ;  
	if( hProcessSnap == INVALID_HANDLE_VALUE )    
	{  
		dwStatus = GetLastError() ; 
		return 0;
	}   
	pe32.dwSize = sizeof( PROCESSENTRY32 ) ;   
	if( !Process32First( hProcessSnap, &pe32 ))  
	{     
		dwStatus = GetLastError() ;   
		return 0;
	}   

	do {  
		hProcess = OpenProcess(  
			PROCESS_ALL_ACCESS ,  
			FALSE ,  
			pe32.th32ProcessID ) ;  

		if( NULL != hProcess )   
		{   

			TCHAR szAppLocation[MAX_PATH] = _T("");
			DWORD dwRet = ::GetModuleFileNameEx( hProcess, NULL, 
				szAppLocation, MAX_PATH );
			if ( 0 == dwRet )
			{
				::Process32Next( hProcessSnap, &pe32 );					
				CloseHandle( hProcess );
				continue;
			}

			TCHAR szProcessName[MAX_PATH] = _T("");
			dwRet = ::GetLongPathName( szAppLocation, szProcessName, 
				MAX_PATH );
			if ( 0 == dwRet )
			{
				::Process32Next( hProcessSnap, &pe32 );
				CloseHandle( hProcess );
				continue;
			}
			CString csProcessName = szProcessName;
			CString csExplorerPath = szExplorerPath;
			if ( 0 == csProcessName.C
[Win32] 服务程序开发(3)Session 0隔离(下)创建SYSTEM权限可交互进程 本博文由优快云博主zuishikonghuan所作,版权归zuishikonghuan所有,转载请注明出处:http://blog.youkuaiyun.com/zuishikonghuan/article/details/47662727 在上上篇博文中,我说了如何编写一个系统服务,上一篇,介绍了如何穿透Session 0在当前用户的桌面上创建一个进程,但是缺陷很明显,如果UAC处于开启状态,创 阅读详情

相关推荐

以system权限启动应用程序

最近在搞一个项目,需要程序开机自动运行,可是程序中调用了底层驱动的一些函数,必须以管理员的权限才能运行,否则程序运行不成功,在XP 下 直接写注册表就可以,可是在VISTA 和 WIN7 下写注册表的方式失效,因为必须以管理员的权限运行才可以,迫于无奈,上网查了N多资料,终于找到

litomboy的专栏 6843

Flash中心修复时报错“组件服务程序启动异常”的解决方法

组件服务程序启动异常”是Flash中心修复过程中可能遇到的一个常见问题。通过修改Flash Helper Service的启动类型,并确保其为自动启动,我们可以有效地解决这个问题。此外,还可以尝试更新或重新安装Flash Player,以及检查系统日志来获取更多信息。希望本文能够帮助你解决Flash中心修复时遇到的问题,让你的电脑恢复正常使用。

mmoo_python的博客 1227

Window不同账户权限优缺点整理

文章目录一、windows系统账户权限二、权限优缺点1. 普通账户权限2、管理员权限3、system权限三、跨权限相关调用1. 启动外部程序2. system权限获取当前用户桌面路径3. system权限下启动外部程序a. 以system权限启动外部程序b. 以当前用户登录权限启动外部程序总结 提示:以下是本篇文章正文内容,下面整理可供参考 PC端程序以管理员权限运行,想要做到在任意系统中开机自启动,经研究发现好像无法实现。 方案一:设置到启动项里。administrator账号登录系统的可以开机自启动

hezf5224的博客 5965

利用VS将窗口服务程序改为Windows服务于后台运行

由于项目需要,赶鸭子上架写了个窗口服务程序,部署在了云服务器上。 实际应用中存在的问题:1、窗口程序容易被误操作关闭,也容易出现程序暂停的情况。2、异常崩溃的时候,缺少服务程序的守护,无法重新自启动。 因此将此窗口程序改写成Windows服务,运行在后台。为服务写守护程序,保证服务崩溃的时候可以立刻重启。后台维护人员,只需要定期分析日志即可维护服务器的运行。如下依据VS2017,将逐步带领完...

weixin_42920092的博客 1520

一个服务程序框架,并在vc6.0win32控制台工程中嵌入manifest使用uac

<br />开发环境:vc6.0 + win7<br />三个主要的函数有main(),为程序入口函数;ServiceMain(),服务函数入口,调用真正的服务程序,相当于服务的主线程函数;ControlHandler,接受系统命令,如暂定服务等,是与系统的接口。<br />代码:<br />#include <stdio.h> #include <windows.h> #include <iostream> using namespace std; SERVICE_STATUS m_Service

Jesus in my place 2916

域管理员密码修改_hash比对

注意!下面的内容仅是思路,动手之前,请备份相关资料。   今天9:06 还没起(因为失业,所以睡懒觉)、就有人在群里问、域管理员密码忘了、怎么办??呃,如果域管理员只有一个,那就悲催了。Server2003 的本地管理员做成域后,可能就是域管理员(我个人认为是的)。 说下我想到的方法吧,我想到了修改SAM, 或是直接访问hash.(一般密码没超过14位,成功率几乎99.999%)。

yhc87的专栏 6145

如何在系统登陆桌面运行程序

这是有位朋友看到我的博客文章《OpenThread种种》中的这个截屏后问的问题,这里解释一下。首先要明白的是,在基于Windows NT(包括2K/XP/2K3等)的系统中,除了smss.exe (Session Manager Subsystem),其他进程都至少关联到一个Window Station和一个Desktop(Desktop隶属于某个Window Station)。在用户登陆后,运行

Sting的专栏 - Under the hood 8733

软件报错处理合集,大部分情况需要下载Webview2、.NET4.8、获取C盘管理员权限等

摘要:软件安装失败主要因缺少WebView2Runtime和.NET Framework 4.8组件,需以管理员权限安装至C盘指定目录并重启电脑。32位系统不兼容,建议更换64位系统。若仍报错,可尝试网页版或重新安装至D盘英文目录。常见问题包括权限不足、防火墙拦截、变量错误等,需检查管理员权限、关闭防火墙、修正变量值。如序列号异常,需重置为00001。多次尝试未果应及时联系客服。

2501_92811878的博客 1754

Linux开机自动启动python脚本程序,或 Jetson nano或Jetson Xavier NX开机自动启动python脚本程序

需要注意的是,在每个rc (1-6).d文件夹下的文件其实都是/etc/init.d文件夹下的文件的一个软连接,也就是说,在 /etc/init.d文件夹下是全部的服务程序,而每个rc(1-6).d只链接它自己启动需要的相应的服务程序!还 需要注意的一点是,在rc5.d里,每个链接的名字都是以S或者K开头的,S开头的表示是系统启动是要随机启动的,K开头的是不随机启动的。,把需要运行的程序命令,或者要运行的应用程序添加到一个任务中,这样在每次开机或指定的时间就可以运行该程序,具体请。

2401_88244350的博客 1901

inno setup 打包后的程序安装后无法打开问题

可能的问题原因: 1、用户把程序安装在系统盘里,是无法直接启动的 解决方法: 1、用户以管理员的权限启动 2、软件制作方: 打开inno setup 所在文件夹,找到SetupLdr.e32文件,使用 Resource Hacker打开(需要先下载),找到Manifest文件,找到并修改为: <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> 使inno setup 打包的程序自

ling_lang的博客 4045

C#实现服务程序自启动(附完整源码))

C#实现服务程序自启动(附完整源码))

希望我的博客,能帮上你解决学习中工作中所遇到的问题 187

MFC实现Windows服务程序(附完整源码)

MFC实现Windows服务程序(附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 1010

JavaScript服务程序自启动(附完整源码)

JavaScript服务程序自启动(附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 283

C# 编写 Windows 服务程序:从入门到精通

除了上述的代码之外,我们还可以在服务类中添加其他自定义方法和属性,以满足特定需求。例如,我们可以在服务类中添加一个定时执行的任务,或者与其他系统组件进行交互。创建项目后,我们将看到一个名为 “Service1.cs” 的文件,其中包含了一个默认的服务类。在安装服务后,我们可以在 Windows 服务管理器中找到并管理已安装的服务。在上面的代码中,我们定义了一个名为 “MyService” 的服务类,继承自。在服务类中,我们还需要添加一些额外的代码来配置服务。方法中,用于将服务类与服务进程关联起来。

BugHunterX的博客 237

利用HipSTR从二代测序数据中精准解析短串联重复序列(STR)的遗传多态性

本文详细介绍了如何利用HipSTR工具从二代测序(NGS)数据中精准解析短串联重复序列(STR)的遗传多态性。通过三步走策略,HipSTR能够高效识别STR区域、估算重复次数并判定基因型,适用于法医鉴定、疾病研究和细胞系鉴定等多个领域。文章还提供了实战操作指南和常见问题解决方案,帮助研究者充分利用NGS数据开展STR分析。

weixin_28702105的博客 483

Nvidia Jetson AGX Orin 如何进入 Recovery Mode(刷机注意事项)

Jetson Orin 如何进入Recovery mode + 刷机注意事项

Pandako's Blog 1万+

使用C# HslCommunication库实现三菱PLC通信(含完整代码示例)

在工业自动化开发中,上位机与PLC的通信是关键环节。HslCommunication库是一个开源的.NET工业通信库,支持三菱、西门子、欧姆龙等多个品牌PLC的通信协议。本文将演示如何通过库实现C#程序与三菱PLC的通信,并提供完整的代码示例。

StevenChen的博客 2291

《Python星球日记》 第43天:机器学习概述与Scikit-learn入门

《Python星球日记》 第43天:机器学习概述与Scikit-learn入门

Code_流苏:在代码中寻诗意,在实践中觅真知 933

AutoSAR系列讲解(入门篇)2.4-Runnables可运行实体

讲解一下Runnable和其工程的实际映射

雪云飞星的博客 3万+

2026年1至9月武汉市房地产价格深度分析报告

本报告基于2026年1月至9月武汉市实际成交案例,从成交价格、区域分布、户型结构、价格走势等维度进行深度分析。数据来源包括武汉市住房保障和房屋管理局备案数据、主要中介机构成交记录及典型楼盘网签案例,覆盖全市15个行政区及主要功能板块。

王国平的博客 333

大规模新闻聚合爬虫实战:Python爬取数百万新闻数据的完整指南

本文详细介绍了如何构建一个大规模新闻聚合爬虫,结合Python异步爬虫技术,实现高效、稳定的新闻数据采集。增加NLP模块对新闻内容做自动分类、情感分析。引入机器学习模型检测新闻真实性。使用分布式爬虫框架进一步提升规模。增加多媒体内容抓取与处理。

2201_76125261的博客 1554

ADAS工作原理解析:如何通过智能技术提升驾驶安全

ADAS通过集成传感器、摄像头、雷达、SoC计算单元以及高效的数据融合技术,提供了一系列主动和被动安全功能,如自动刹车、车道保持、自适应巡航控制等。这些功能共同作用,不仅减少了交通事故的发生,还大幅提升了驾驶员的驾驶体验和安全性。随着技术的进步,ADAS的功能将越来越智能,最终迈向全自动驾驶的未来🚗💨。

weixin_43199439的博客 1149

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: VC 用发音函数Beep()播放简谱音乐
下一篇: 临界区的LockCount为何小于-1
sky-defender
博客等级 码龄19年 12粉丝 30原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值