system.ComponentModel.Win32Exception (0x80004005): 目录名无效。 解决方法

有时候我们需要在程序中调用 cmd.exe  执行一些命令

比如 我们会在程序写到

  /// <summary>
        /// 执行Cmd命令
        /// </summary>
        /// <param name="workingDirectory">要启动的进程的目录</param>
        /// <param name="command">要执行的命令</param>
        private void StartCmd(String workingDirectory, String command)
        {
            Process p = new Process();
            p.StartInfo.FileName = "cmd.exe";
            p.StartInfo.WorkingDirectory = workingDirectory;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.CreateNoWindow = true;
            p.Start();
            p.StandardInput.WriteLine(command);
            //p.StandardInput.WriteLine("exit");
        }

代码是一点问题都没有的。你在本地调试也没有问题。

可是就是一放到服务器上。就可能出现  system.ComponentModel.Win32Exception (0x80004005): 目录名无效。 解决方法

在服务器中将你代码中要调用的的

workingDirectory 目录  的internet来宾账户设置为完全控制即可。

system.ComponentModel.Win32Exception (0x80004005): 目录名无效。 解决方法,布布扣,bubuko.com

时间: 2024-08-25 05:43:36

system.ComponentModel.Win32Exception (0x80004005): 目录名无效。 解决方法的相关文章

Include设置layout_*无效解决方法

在include标签中不能省略 layout_width或者layout_height否则设置layout_weight就会无效.如下设置即可 <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0.0

ActionBar自己定义改动无效解决方法

假设程序支持API11下面的版本号,那么须要改动多个地方 values-v14 和values-v11以下的styles中也要写上 <style name="AppTheme" parent="AppBaseTheme">        <!-- All customizations that are NOT specific to a particular API-level can go here. -->        <item

Ubuntu 14.04 关机键无效解决方法

     这几天开始研究ubuntu 14.04软件,安装Cairo-Dock后发现右上角的关机.重启.注销菜单点击都没了反应只能通过命令实现,后来经过研究,发现只要设置了 Cairo-Dock 开启自启动,那三个键就会失效.解决方法如下: 1.编辑/usr/lib/i386-linux-gnu/cairo-dock/cairo-dock-launcher-API-daemon(可在/usr/lib下搜索找到caior-dock) sudo vim /usr/lib/i386-linux-gnu

ActionBar自定义修改无效解决方法

如果程序支持API11以下的版本,那么需要修改多个地方 values-v14 和values-v11下面的styles中也要写上 <style name="AppTheme" parent="AppBaseTheme"> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="act

Ubuntu12.04更新出现 The system is running in low-graphics mode解决方法

这两天都困在这个问题上. 感谢:http://blog.chinaunix.net/uid-26748719-id-3780062.html 原因:显卡没驱动起来 解决方法: sudo apt-get install fglrx     //linux下安装ati显卡驱动的命令 sudo reboot     //安装完重启系统 Ubuntu12.04更新出现 The system is running in low-graphics mode解决方法

DataGridViewComboBoxColumn值无效解决方法

值无效,可能是你下拉框选项,没有这样的值,而你却设置这个值. dataGridView1.Rows[i].Cells[1].Value?=?"选项一"; 解决方法就是在窗体的构造函数里添加如下代码: this.dataGridView1.DataError?+=?delegate(object?sender,?DataGridViewDataErrorEventArgs?e)?{?}; 1.必须确定,给DataVridView赋值,是在DataGridViewComboBox已经绑定了

IOS开发证书变成“此证书的签发者无效”解决方法

转载自:http://blog.csdn.net/h1101723183/article/details/50667325 IOS开发证书全部变成无效,如下图  打包提示错误  解决方法: 1. 下载https://developer.apple.com/certificationauthority/AppleWWDRCA.cer的证书,然后双击安装. 2. 在导航栏那边,显示-显示已过期的证书  3. 点击 “登录”,并且选择 “所有项目” ,并在搜索栏下输入 apple w,其中有一个是无效

requestWindowFeature(Window.FEATURE_NO_TITLE)无效解决方法

今天在<第一行代码>上学习做自定义标题栏,需要将系统自带的标题栏隐藏掉,使用自定义的标题栏,结果发现,requestWindowFeature(Window.FEATURE_NO_TITLE); 这句代码无效,标题栏无法隐藏,可我以前都可以隐藏啊,今天怎么不可以了,最终发现是Activity的继承问题,我的代码是这样的 public class TitlebarActivity extends AppCompatActivity 可以看出我的Activity是继承自AppCompatActiv

Visual Studio 2013附加进程调试IE加载的ActiveX Control无效解决方法

默认Attach to选择了Automatically determine the type of code to debug,显示Native Code.但附加进程到iexplore.exe断点无法命中. 解决方法是手动选择Code Type Natvie.