473,395 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

m_oProc = new Process();

ProcessStartInfo oInfo;

oInfo = new ProcessStartInfo("\\\\" + sSourceServer + "\\" +
Environment.SystemDirectory.Replace("C:", "C$") + "\\psexec.exe", " \
\STLLHK8PX41, -u <service admin account-p <service admin password
-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

Aug 13 '07 #1
1 10608

On Aug 13, 4:03 pm, porsc...@yahoo.com wrote:
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?

Aug 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Petrucci2000 | last post by:
Is there a way to call VBScript from C# Component (COM+ Package running on Server) I am thinking of using the Process Namespace and invoking CScript.exe? Is there a better way? Thanks a lot I...
1
by: Art Vandelay | last post by:
Hello, I am trying to execute a VBScript, that exists inside of my project (via Add New Item>VBScript), through a button1_click event. I have not been able to find any code samples to...
2
by: Roja Doja | last post by:
I need to be able to change the Terminal Services attributes. Using vbscript on Server 2003 this is easy enough, as described at ...
4
by: Patrick Dugan | last post by:
I am trying to launch a vbscript from within vb.net (vs2005) The script itself requires a parameter of a filename to process. I have tried: Dim P As Process =...
6
by: ShieldsJared | last post by:
Hello all, I've been working on an application for a while now and have now come to a standstill. I have an application that I intend to have stored on a file server (developed in C#), which...
1
by: rsine | last post by:
I need to execute a batch file (.bat) on a remote system. Can this be done? I have been trying to use the System.Diagnostics.Process.Start with no success. So, I am wondering if I am using the...
1
by: sjoshi | last post by:
Hi All I'm trying to use the Process/ProcessStartInfo class to use sysinternals psexec tool to run a remote command but I'm unable to get the output. The same command thru a DOS window runs fine...
4
by: =?Utf-8?B?emlubw==?= | last post by:
if I run the following from the command line as: C:\PsTools>psexec -u domain\myUser -p myPassword -i \\remoteServer cmd.exe it run successfully and it opens the command window on the remote...
0
by: .nLL | last post by:
Erorr is --------------------- Microsoft VBScript runtime error '800a0046' Permission denied /a.asp, line 3 -----------------------
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.