473,591 Members | 2,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET site hangs when schtasks /v switch is invoked


I have an ASP.NET website in which if a certain button is clicked, it
will enumerate the scheduled tasks on a certain server. I use psexec to
call "schtasks /query /fo list" on a remote server and this runs fine.
However, when I tack on a /v switch to the end of that, the site hangs
up completely, we start getting HTTP 403.9 errors (with only 1
connection to the site), and I eventually have to do an IISRESET to get
everything going again. Below is the code for the btnClick event:

private void btnTasks_Click( object sender, System.EventArg s e)
{
Process p = new Process();
p.StartInfo.Fil eName = @"C:\windows\sy stem32\psexec.e xe";
p.StartInfo.Use ShellExecute = false;
p.StartInfo.Red irectStandardOu tput = true;
p.StartInfo.Red irectStandardEr ror = true;
p.StartInfo.Arg uments = " \\\\10.20.70.20 schtasks /query /fo list";
p.Start();
p.WaitForExit() ;;

if ( p.ExitCode != 0 )
{

Response.Write( p.StandardError .ToString());
}
else
{

SkipLines();

Response.Write( "<b>Schedul ed Tasks<br>");
Response.Write( "---------------------------<br></b>");

for (i=1;i<100;i++)
{
string outputline = p.StandardOutpu t.ReadLine();
Response.Write( outputline + "<br>");

}
}
}
This of course as I said runs fine but just tack on a "/v" switch so
that it reads "p.StartInfo.Ar guments = " \\\\10.20.70.20 schtasks
/query /fo list /v" and then we will hang forever. The /v switch runs
fine from a command prompt against remote servers so it is something to
do with ASP.NET possibly and how it handles the redirected output
perhaps? (just guessing here)

Please no posts about using Win32_Scheduled Jobs instead of my method as
that only enumerates jobs filed with the "AT" command.

Help much appreciated.

Nov 19 '05 #1
0 2173

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

Similar topics

12
2473
by: JD | last post by:
This is another Python problem, I think might be unrelated to the earlier bug I found, and eventually figured out how to report it to Sourceforge. This is related to a question I have about Python hanging up either from a shell, or by importing a module. This I would not consider a bug, but more on my inexperience with Python. If my code causes Python to just hang up, and not allowing me to break out with control-C or...
2
2976
by: Eric Woudenberg | last post by:
I just installed a Python 2.3.4 Windows binary on a friend's WinXP machine (because the latest Cygwin-provided Python 2.3 build leaves out the winsound module for some reason). When I try and run this newly installed Python from bash it just hangs (no version message, no prompt, CPU is idle). When I run it from IDLE, or the DOS CMD prompt, it runs fine. Also, Python scripts using the new version run fine, even invoked on the bash command...
7
1350
by: McKirahan | last post by:
When developing a new site, I often use the following : <!-- This is page: WEB_Page.asp --> <!--#include file="WEB_0.asp"--> <!--#include file="WEB_1.asp"--> <!--#include file="WEB_Page.htm"--> <!--#include file="WEB_2.asp"--> "WEB" varies and is an acronym for a client's or site's name.
1
1580
by: JQA Academia | last post by:
I've reinstalled twice now... I've got the Visual Studio.net Academic version 2003. During installation, I get no errors but when I try to open a new project from the inital start page, it just hangs and then eventually the application stops responding. I'm running on Windows XP Professional, I've made sure IIS is activated. Any Ideas?
2
2635
by: dvestal | last post by:
I'm new to .NET remoting, and I'm having trouble getting a callback to work from a server. I've been through a dozen webpages and the references available to me, but I'm still missing something. I'm trying to have a client pass a callback function to a server, and the server call it. The callback signature is determined by public interfaces referenced by both client and server. I've worked through about three problems on my own, but...
37
4943
by: PeterOut | last post by:
I am using MS Visual C++ 6.0 on Windows XP 5.1 (SP2). I am not sure if this is a C, C++ or MS issue but fscanf has been randomly hanging on me. I make the call hundreds, if not thousands, of times but it hangs in different places with the same data. The offending code follows. ReadFile(char *csFileName) { float fFloat1, fFloat2;
5
3291
by: Saya | last post by:
Hi Folks, I have now spend app. 3 days to get the below scenario to work, but can not get there! ..Net version = 2.0.50727 Windows version = Microsoft Windows = Windows Server 2003 Now I have to develop a webservice which is run on the server. The
2
2659
by: JRough | last post by:
I cannot log into our web site. I have a test web site and a real site. On Friday I could log in and today Monday I cannot log in. I have 2 databases In PHPMyAdmin, the real database and and a test database site which used to be mirrors. Someone else did upgrade work on the real site which I must troubleshoot because they are gone. Symptoms:I can select in myPHPadmin the test database but when I try to switch in PHPMyAdmin from the...
2
1297
by: colin | last post by:
Hi, I seem to have introduced a probem into my application wich cuases the IDE to hang when I switch from debug to reease mode. it doesnt even consume any cpu %, just sits there, with the debug/release drop down menu stil half visible, and not even the close buton or taskbar menu works - has to be clsoed from taskmanager. It seemed to start after I did 2 things,
0
7934
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7870
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8362
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7992
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5400
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3850
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1465
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.