我尝试执行 .cmd 以从 SVN 导出文件,它在我的本地机器(WS2003 SP2 IIS 身份:本地系统)中手动工作,但在执行服务器中失败(相同配置)。
我执行的脚本是:
echo.%Date%-%Time%- Username %username%>>c:\vpcheckcode\logsvn.txt
svn export %svnUrl% %srcFolder% --force --username %usr% --password %psw%
如果我尝试简单地复制一个文件,没有 svn,它可以工作。
当我手动执行它时,它会记录我的用户并导出文件。在开发PC上它不记录用户但它工作,在执行服务器它不记录用户并且它不工作。
我尝试以这种方式执行 .cmd:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.FileName = strFileName;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = svnUrl + " " + srcFolder+ " " + usr+" "+psw;
using (Process exeProcess = Process.Start(startInfo))
{
pid = exeProcess.Id;
EventLog.WriteEntry("VPCheckCodeSrvDll.ExecuteScriptSVN", "avviato pid svn: " + pid.ToString(), EventLogEntryType.Warning);
if (!exeProcess.WaitForExit((int)_svnExportTimeout))
{
exeProcess.Kill();
该进程挂起,直到它被杀死。
C:\Documents and Settings\myuser>tlist 4980
4980 cmd.exe
CWD: c:\windows\system32\inetsrv\
CmdLine: cmd /c ""C:\ANALISI\000000-xx-v90\SVN\svnExport.cmd" https://svn.mysite.local/repos/HA/branches/H
VirtualSize: 11332 KB PeakVirtualSize: 15492 KB
WorkingSetSize: 1832 KB PeakWorkingSetSize: 1848 KB
NumberOfThreads: 1
2704 Win32StartAddr:0x4ad07670 LastErr:0x000000cb State:Waiting
5.2.3790.3959 shp 0x4AD00000 cmd.exe
5.2.3790.4937 shp 0x7C800000 ntdll.dll
5.2.3790.5069 shp 0x77E40000 kernel32.dll
7.0.3790.3959 shp 0x77BA0000 msvcrt.dll
5.2.3790.4455 shp 0x7D1E0000 ADVAPI32.dll
5.2.3790.4759 shp 0x77C50000 RPCRT4.dll
5.2.3790.4455 shp 0x76F50000 Secur32.dll
5.2.3790.4033 shp 0x77380000 USER32.dll
5.2.3790.4396 shp 0x77C00000 GDI32.dll
5.2.3790.3959 shp 0x71BD0000 MPR.dll
5.2.3790.3959 shp 0x76290000 IMM32.DLL
有什么建议吗?