Hey, I have a question concerning the CreateProcessWithLogonW function
imported from the advapi32 dll. For some reason I cant get the appName
and cmdLine paramters to work together. For example, I'm trying to use
the Perforce command line utility (p4.exe) to download some files to the
local computer. So I set appName="p4.exe" and cmdLine="print -o
\"c:\\file.txt\" -q \"//depot/files/file.txt\"". So then I call
CreateProcessWithLogonW(username, domain, password,
LogonFlags.LOGON_WITH_PROFILE, appName, cmdLine,
CreationFlags.CREATE_DEFAULT_ERROR_MODE, IntPtr.Zero, null, ref si, out
pi), which runs fine (return non 0) but the file never downloads. The
only workaround I have been able to find so far is to create a console
app and use the process class as:
Process.Start("p4.exe", "print -o \"c:\\file.txt\" -q
\"//depot/files/file.txt\""). Then passing the path of the executable
that gets created to the CreateProcessWithLogonW function as the appName
paramter with cmdLine=null:
CreateProcessWithLogonW(username, domain, password,
LogonFlags.LOGON_WITH_PROFILE, ConsoleExePath, null,
CreationFlags.CREATE_DEFAULT_ERROR_MODE, IntPtr.Zero, null, ref si, out
pi), which works. But this is obviously not a desirable solution since I
would have to create a console app everytime i wanted to download a file
from Perforce from a web app. Any ideas on what I'm doing wrong with the
appName and cmdLine paramters, or anyone know what functions get called
in CreateProcessWithLogonW or how it works so I can possibly try to
duplicate it? Thanks in advance for any help...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!