English 中文(简体)
起点
原标题:Starting cmd.exe problem

在Windows,当指挥时(cmd.exe),登记处主要负责:

HKLMSoftwareMicrosoftCommand Processor
HKCUSoftwareMicrosoftCommand Processor

检查价值为“AutoRun”。 如果发现,价值中标出的批量文档即予执行,提供类似于汽车的功能。 如果这两个关键因素都包含自治价值观,那么这两个要素都将运行。 !!

使用<条码>Process.Start,操作成厘米,没有发生自动记录。 我目前的法典是:

private openShell( string folder )
{
    ProcessStartInfo startInfo = new ProcessStartInfo()
        {
            FileName = Environment.GetEnvironmentVariable( "COMSPEC" ) ?? "cmd.exe",
            Arguments = "/k cd "" + folder + """,
            UseShellExecute = true
        };

    try
    {
        using ( var exeProcess = System.Diagnostics.Process.Start( startInfo ) )
        {
            exeProcess.WaitForExit();
        }
    }
    catch
    {
        // Log error.
    }
}

我也试图将其减少到最简单的形式:

System.Diagnostics.Process.Start( "cmd.exe" );

一切我都努力完美地工作(在指挥窗口启用时),但“自治”行为从未发生。

最佳回答

我发现这一点。 问题在于视窗储存(和检索)数据如何从登记制度64个轨道版本的登记册中找到。 我的法典是罚款的。 。 根据该条:

On 64-bit Windows, portions of the registry entries are stored separately for 32-bit application and 64-bit applications and mapped into separate logical registry views using the registry redirector and registry reflection, because the 64-bit version of an application may use different registry keys and values than the 32-bit version. There are also shared registry keys that are not redirected or reflected.

我的解决办法是,在以下几个方面增加我的“自治”关键:

HKLMSoftwareWow6432NodeMicrosoftCommand Processor

我真正得到的东西是,我以前就开始这样做。 我很少与登记处 f,我完全忘记了。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签