473,324 Members | 2,193 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,324 software developers and data experts.

system.diagnostic.process Error Output

I have been trying to get a process to start up and run with arguments
passed to it. I have gotten close (Thanks to help from this board) but I
there is a failure while I'm running this because the c:\bin\xcacls starts
nothing happens.

How can I see output from the console i was trying to get the
ProcessStartInfo.RedirectStandardOutput Property to work but even if I got
the system to process it I didn;t know where the output was being sent. I'm
in over my head but hoping to try and get this to run.

Anybody know what I can do to get this to give me the output?
<%@ Page Language="vbscript" Debug="true" %>
<script runat="server">
Sub submit(sender As Object, e As EventArgs)

Dim csc As System.Diagnostics.Process = New System.Diagnostics.Process()
csc.StartInfo.FileName = "c:\bin\xcacls"
csc.StartInfo.Arguments = "c:\blaster /G GOB\pbergson:F /Y"
csc.Start()

End Sub
</script>

<html>
<body>
<form runat="server">
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form>
</body>
</html>

Thank-You

--

Paul Bergson
Nov 19 '05 #1
5 2044
It's most likely a security-related problem.
To test this theory you can try having it run under your personal user
account via impersonation.
Here's more info:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Paul Bergson" <pb******@mnpower.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
I have been trying to get a process to start up and run with arguments
passed to it. I have gotten close (Thanks to help from this board) but I
there is a failure while I'm running this because the c:\bin\xcacls starts
nothing happens.

How can I see output from the console i was trying to get the
ProcessStartInfo.RedirectStandardOutput Property to work but even if I got
the system to process it I didn;t know where the output was being sent.
I'm
in over my head but hoping to try and get this to run.

Anybody know what I can do to get this to give me the output?
<%@ Page Language="vbscript" Debug="true" %>
<script runat="server">
Sub submit(sender As Object, e As EventArgs)

Dim csc As System.Diagnostics.Process = New System.Diagnostics.Process()
csc.StartInfo.FileName = "c:\bin\xcacls"
csc.StartInfo.Arguments = "c:\blaster /G GOB\pbergson:F /Y"
csc.Start()

End Sub
</script>

<html>
<body>
<form runat="server">
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form>
</body>
</html>

Thank-You

--

Paul Bergson

Nov 19 '05 #2
Not sure who the user is, think it is admin from my server settings. When I
run task manager I see the process fire and the user name is "Network
Service." This is even if I use the account impersonation. I get the same
thing happening either way.

If I don't pass any arguments the job shows up on the task manager and just
sits there until I kill it. If I pass it arguments then the job acts like
it runs but the job doesn't show up in the task manager. But the job hangs
in a dos command if no arguments are supplied, so I'm assuming the job
thread is trying to tell me it needs data and then is waiting for a response
to the error. But I don't know if that is why.

Is there any way I can see what is happening on this thread for output?

--

Paul Bergson

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uU**************@TK2MSFTNGP09.phx.gbl...
It's most likely a security-related problem.
To test this theory you can try having it run under your personal user
account via impersonation.
Here's more info:
http://msdn.microsoft.com/library/de...ersonation.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Paul Bergson" <pb******@mnpower.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
I have been trying to get a process to start up and run with arguments
passed to it. I have gotten close (Thanks to help from this board) but I there is a failure while I'm running this because the c:\bin\xcacls starts nothing happens.

How can I see output from the console i was trying to get the
ProcessStartInfo.RedirectStandardOutput Property to work but even if I got the system to process it I didn;t know where the output was being sent.
I'm
in over my head but hoping to try and get this to run.

Anybody know what I can do to get this to give me the output?
<%@ Page Language="vbscript" Debug="true" %>
<script runat="server">
Sub submit(sender As Object, e As EventArgs)

Dim csc As System.Diagnostics.Process = New System.Diagnostics.Process() csc.StartInfo.FileName = "c:\bin\xcacls"
csc.StartInfo.Arguments = "c:\blaster /G GOB\pbergson:F /Y"
csc.Start()

End Sub
</script>

<html>
<body>
<form runat="server">
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form>
</body>
</html>

Thank-You

--

Paul Bergson


Nov 19 '05 #3
Oh, you must be running Windows 2003. Network Service is the default
account that is used and it is not an Administrator level account by default
and probably doesn't have permission to access the file.
It sounds like it's working with impersonation as long as you pass it the
parameters it expects, so what is the problem?

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Paul Bergson" <pb******@mnpower.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
Not sure who the user is, think it is admin from my server settings. When
I
run task manager I see the process fire and the user name is "Network
Service." This is even if I use the account impersonation. I get the
same
thing happening either way.

If I don't pass any arguments the job shows up on the task manager and
just
sits there until I kill it. If I pass it arguments then the job acts like
it runs but the job doesn't show up in the task manager. But the job
hangs
in a dos command if no arguments are supplied, so I'm assuming the job
thread is trying to tell me it needs data and then is waiting for a
response
to the error. But I don't know if that is why.

Is there any way I can see what is happening on this thread for output?

--

Paul Bergson

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uU**************@TK2MSFTNGP09.phx.gbl...
It's most likely a security-related problem.
To test this theory you can try having it run under your personal user
account via impersonation.
Here's more info:

http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Paul Bergson" <pb******@mnpower.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
>I have been trying to get a process to start up and run with arguments
> passed to it. I have gotten close (Thanks to help from this board) but I > there is a failure while I'm running this because the c:\bin\xcacls starts > nothing happens.
>
> How can I see output from the console i was trying to get the
> ProcessStartInfo.RedirectStandardOutput Property to work but even if I got > the system to process it I didn;t know where the output was being sent.
> I'm
> in over my head but hoping to try and get this to run.
>
> Anybody know what I can do to get this to give me the output?
>
>
> <%@ Page Language="vbscript" Debug="true" %>
>
>
> <script runat="server">
> Sub submit(sender As Object, e As EventArgs)
>
> Dim csc As System.Diagnostics.Process = New System.Diagnostics.Process() > csc.StartInfo.FileName = "c:\bin\xcacls"
> csc.StartInfo.Arguments = "c:\blaster /G GOB\pbergson:F /Y"
> csc.Start()
>
> End Sub
> </script>
>
> <html>
> <body>
> <form runat="server">
> <asp:Button OnClick="submit" Text="Submit" runat="server" />
> <p><asp:Label id="lbl1" runat="server" /></p>
> </form>
> </body>
> </html>
>
> Thank-You
>
> --
>
> Paul Bergson
>
>



Nov 19 '05 #4
Microsoft in their infinite wisdom gave no easy way to manage access rights.
I used to be a developer but traded in my coding apron for a networking
apron. There are probably ways to manage rights with C or some other
language but forget trying to do it easily with a scripting language. I
need to create a mail enabled user in AD and create a multiple folder
hierarchy for any new user for the system. The folders have different ACL's
for each folder and sub-folder. This window has to be able to be run by
unprivileged help desk personnel.

What I have ended up doing is writing a asp page with some vb script that I
can get everything to work except set the permissions. When I call the
Resource kit program XCACLS.exe it will fire off but the parameters don't
seem to be getting passed correctly. I never get them to work. So I'm
doing something wrong but I can;t get any error messages back to see what it
doesn't like.

What I want to see is the output from the request.

I'm stumped and like I said I'm over my head because I have gotten to the
point of guessing (I have a day of time or more in on this when it should
probably take someone who knows what they are doing 10 minutes).

--

Paul Bergson MCT, MCSE, MCSA, CNE, CNA, CCA

This posting is provided "AS IS" with no warranties, and confers no rights.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:O1**************@TK2MSFTNGP14.phx.gbl...
Oh, you must be running Windows 2003. Network Service is the default
account that is used and it is not an Administrator level account by default and probably doesn't have permission to access the file.
It sounds like it's working with impersonation as long as you pass it the
parameters it expects, so what is the problem?

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Paul Bergson" <pb******@mnpower.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
Not sure who the user is, think it is admin from my server settings. When
I
run task manager I see the process fire and the user name is "Network
Service." This is even if I use the account impersonation. I get the
same
thing happening either way.

If I don't pass any arguments the job shows up on the task manager and
just
sits there until I kill it. If I pass it arguments then the job acts like it runs but the job doesn't show up in the task manager. But the job
hangs
in a dos command if no arguments are supplied, so I'm assuming the job
thread is trying to tell me it needs data and then is waiting for a
response
to the error. But I don't know if that is why.

Is there any way I can see what is happening on this thread for output?

--

Paul Bergson

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uU**************@TK2MSFTNGP09.phx.gbl...
It's most likely a security-related problem.
To test this theory you can try having it run under your personal user
account via impersonation.
Here's more info:

http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Paul Bergson" <pb******@mnpower.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
>I have been trying to get a process to start up and run with arguments
> passed to it. I have gotten close (Thanks to help from this board) but I
> there is a failure while I'm running this because the c:\bin\xcacls

starts
> nothing happens.
>
> How can I see output from the console i was trying to get the
> ProcessStartInfo.RedirectStandardOutput Property to work but even if
I got
> the system to process it I didn;t know where the output was being

sent. > I'm
> in over my head but hoping to try and get this to run.
>
> Anybody know what I can do to get this to give me the output?
>
>
> <%@ Page Language="vbscript" Debug="true" %>
>
>
> <script runat="server">
> Sub submit(sender As Object, e As EventArgs)
>
> Dim csc As System.Diagnostics.Process = New

System.Diagnostics.Process()
> csc.StartInfo.FileName = "c:\bin\xcacls"
> csc.StartInfo.Arguments = "c:\blaster /G GOB\pbergson:F /Y"
> csc.Start()
>
> End Sub
> </script>
>
> <html>
> <body>
> <form runat="server">
> <asp:Button OnClick="submit" Text="Submit" runat="server" />
> <p><asp:Label id="lbl1" runat="server" /></p>
> </form>
> </body>
> </html>
>
> Thank-You
>
> --
>
> Paul Bergson
>
>



Nov 19 '05 #5
I thought about this and decided to make the network service a local admin
and pointed the xcacls at a local file. That worked.

So...................

How can I get a spawned process to impersonate an id. Is this what you sent
me last time and I haven't installed it properly?

Here is what I have in my web.config that resides at the root of my web
site. filerAdmin is a domain account that has full rights on a Linux Box (A
NetApps Filer if you are familiar with them).

<configuration>

<system.web>

<authentication mode="Windows" />

<identity impersonate="true"
userName="gob\filerAdmin" password="xxxxxxxx"/>

</system.web>

</configuration>
--

Paul Bergson

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:O1**************@TK2MSFTNGP14.phx.gbl...
Oh, you must be running Windows 2003. Network Service is the default
account that is used and it is not an Administrator level account by default and probably doesn't have permission to access the file.
It sounds like it's working with impersonation as long as you pass it the
parameters it expects, so what is the problem?

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Paul Bergson" <pb******@mnpower.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
Not sure who the user is, think it is admin from my server settings. When
I
run task manager I see the process fire and the user name is "Network
Service." This is even if I use the account impersonation. I get the
same
thing happening either way.

If I don't pass any arguments the job shows up on the task manager and
just
sits there until I kill it. If I pass it arguments then the job acts like it runs but the job doesn't show up in the task manager. But the job
hangs
in a dos command if no arguments are supplied, so I'm assuming the job
thread is trying to tell me it needs data and then is waiting for a
response
to the error. But I don't know if that is why.

Is there any way I can see what is happening on this thread for output?

--

Paul Bergson

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:uU**************@TK2MSFTNGP09.phx.gbl...
It's most likely a security-related problem.
To test this theory you can try having it run under your personal user
account via impersonation.
Here's more info:

http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Paul Bergson" <pb******@mnpower.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
>I have been trying to get a process to start up and run with arguments
> passed to it. I have gotten close (Thanks to help from this board) but I
> there is a failure while I'm running this because the c:\bin\xcacls

starts
> nothing happens.
>
> How can I see output from the console i was trying to get the
> ProcessStartInfo.RedirectStandardOutput Property to work but even if
I got
> the system to process it I didn;t know where the output was being

sent. > I'm
> in over my head but hoping to try and get this to run.
>
> Anybody know what I can do to get this to give me the output?
>
>
> <%@ Page Language="vbscript" Debug="true" %>
>
>
> <script runat="server">
> Sub submit(sender As Object, e As EventArgs)
>
> Dim csc As System.Diagnostics.Process = New

System.Diagnostics.Process()
> csc.StartInfo.FileName = "c:\bin\xcacls"
> csc.StartInfo.Arguments = "c:\blaster /G GOB\pbergson:F /Y"
> csc.Start()
>
> End Sub
> </script>
>
> <html>
> <body>
> <form runat="server">
> <asp:Button OnClick="submit" Text="Submit" runat="server" />
> <p><asp:Label id="lbl1" runat="server" /></p>
> </form>
> </body>
> </html>
>
> Thank-You
>
> --
>
> Paul Bergson
>
>



Nov 19 '05 #6

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

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
8
by: Terry Gray | last post by:
Using Python 2.2 in Debian linuxI am trying to change to a different directory, execute a 'make all' command, and redirect the output of the subshell to a PyQt window... I should be able to...
1
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and...
2
by: adish11 | last post by:
I'm using Web Application and want to execute an MSDOS executable with some parameters like this example: software.exe -i -x How do I use System.Diagnostic.Process to execute this .exe with...
5
by: Michael Johnson Sr. | last post by:
I am starting and stopping a process using System.Diagnostic.Process. aspnet_wp is running as system rather than machine (as per machine.config modification). When the process gets started, it...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
18
by: v4vijayakumar | last post by:
is there any standard way to extract output from system(3) function? TIA.
2
by: test3 | last post by:
Hello folks, I'm using System.Diagnostics.Process to start a thirdparty program (that works perfectly when started via command line). I'm using Process.StandardOutput to get the output of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.