Run VBScript files remotely with psexec, cscript, Process, and ProcessStartInfo

  • Thread starter Thread starter porsch55
  • Start date Start date
P

porsch55

m_oProc = new Process();

ProcessStartInfo oInfo;

oInfo = new ProcessStartInfo("\\\\" + sSourceServer + "\\" +
Environment.SystemDirectory.Replace("C:", "C$") + "\\psexec.exe", " \
\STLLHK8PX41 said:
-i -e cscript.exe \\STLLHK8PX41\C$\NetworkSupportTools\Tasks
\WindowsExplorer.vbs STLDJSRNRC1 " );

oInfo.WorkingDirectory = \\frmweb02\NewSupportTools$\Tasks;

oInfo.UseShellExecute = true;

oInfo.RedirectStandardOutput = false;

oInfo.RedirectStandardError = false;

oInfo.RedirectStandardInput = false;

m_oProc.StartInfo = oInfo;

m_oProc.Start();

All the bellow commands run under a service admin account.

Error: "The procedure entry point CryptUnprotectMemory could not be
located in the dynamic link library Crypt32.dll."

When running this in debug mode locally on my machine, I get the above
error, but it does succeed in running the script.

When I run it remotely, I don't get the above error message and the
process hangs. (Maybe the above error message does occur on the remote
machine, but I don't see it logged on as the service account)

When I run it from the command line locally, it succeeds with no
errors.

Web Server: Microsoft Windows server 2003 R2
Security: Windows Authentication, Impersonating a Admin Service
Account
Client Machine: Windows XP Professional SP2
Remote Machine: Windows XP Professional SP2
etc...: Ask
 
Error: "The procedure entry point CryptUnprotectMemory could not be
located in the dynamic link library Crypt32.dll."

This is probably a cascaded error, so try running Process Monitor on
the remote server and look for anything that fails when you run the
script.
Newsgroups: microsoft.public.dotnet.languages.csharp

O RLY?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top