command line scripts

Does anyone know how I can run command line scripts using asp.net and vb? I am mostly interested in using the iis command line script iisweb.vbs to create and delete websites. I would like to have a form that, when submited, runs the the command line script using the form values.

Thanks
0
el_flashguy
6/9/2004 2:06:26 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

2 Replies
718 Views

Similar Articles

[PageSpeed] 36
Get it on Google Play
Get it on Apple App Store

Look at the Process class in the System.Diagnostics namespace. You can also use the class to redirect output into a stream for reading from your application. You might need to twiddle with security settings in order to have the permissions to do this from an ASP.NET app, impersonation is one option. Feel free to ask more questions, hope this give you some pointers.
Scott
http://www.OdeToCode.com/blogs/scott/
0
bitmask
6/9/2004 2:13:23 PM
hi bitmask,

Can you tell me more about permission,
I use IIS 5, and set the impersonate property in the web.config:
<Identity Impersonate="true">
but I still can't run a command from asp.net
and the code run perfectly on windows app.
this is my code:
Try
Dim myProcess As New Process
Dim myProcessStartInfo As New ProcessStartInfo("C:\temp\test.bat")
myProcessStartInfo.UseShellExecute = False
myProcessStartInfo.RedirectStandardOutput = True
myProcessStartInfo.RedirectStandardError = True
myProcess.StartInfo = myProcessStartInfo
myProcess.Start()
Response.Write("error: " & myProcess.StandardError.ReadToEnd & "<br>")
Dim myStreamReader As StreamReader = myProcess.StandardOutput
' Read the standard output of the spawned process.
Dim myString As String = myStreamReader.ReadLine()
Console.WriteLine(myString)
myProcess.Close()
Response.Write("success" & "<br>")
Catch ex As Exception
Response.Write(ex.Message & "<br>")
End Try
Have you any idea?
thanks
0
toutr2002
12/27/2004 5:28:02 PM
Reply:

Similar Artilces:

get Command line scripting results!
Hey all, i have a web application that at a given point i make this application execute a batch file, this batch file contains commands executed in command line to do specific actions.as i do execute that batch file programmatically, i'm looking for a way to read the result of executing these commands...... e.g. if you write "C:\>hhhshs" the result would be "hhhshs is not recognized as an internal or external command, operable program or batch file" if you write "C:\>ipconfig" the result woul be sth else. what i want is a way how to read these resu...

Help: Starting a script with command line arguments
------=_NextPart_000_001A_01C11040.A23E5570 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit My question is: how can I pass arguments to a script from the command line? The script at the tail of this message is what I thought would print the 2 arguments I passed into the script, yet the output for this snippet is: Here ya go: Here ya go: Count is: 0 Not enough arguments to get started #\perl\bin use strict; # use strict! It will save you many headaches use File::Basename; use Carp; my $count = @_; print "Here ya go: $_[0]\n&...

TFS Command Line Get Command
Hi Can you pls help me how to pull the latest version or label from the TFS through Command Line. I went through the msdn documentation. I am not able to get a clear picture. I am expecting some command with example where I can pass the server name, Credentials and sourcepath and Destination path. Basically I want to pull the get latest to a local path which  will be specified in the command line utility. Hope so I am clear.  Pls help me.RegardsFinny  You can use tf command line utilityThis utility can be found in C:/ProgramFiles/Microsoft Visual Studio (9 or 8...

Command line script to get latest from VSS for PB 8
Hi! I am using Powerbuilder 8 and Microsoft Visual Source Safe for the source control. I am trying to create a batch file which will get the latest source from the VSS and will start the build. My problem is how to get the latest source from the VSS, using batch file. I have the script for creating the build from command line but now I am stuck with the latest source problem. I was searching for the help on the net and I found that PB 9 comes with a utility ORCASCR9.exe by using which I can easily perform the desired tasks but that utility does not run with PB 8... so noway to go ...

how to get the line number of a line in a Power script ?
in the C language, we have the variable __LINE__ to in,dicate to us the value of the current line at runtime. In PB script we would like to get the value of the line to print it or display it , but we don't known how to do can Somebody help me ? thanks PopulateError(0, 'whatever') MessageBox('', 'line number = ' + string(Error.Line) ) On Mon, 20 Mar 2000 16:28:59 +0100, "MARDUEL" <patrick.marduel@energy.alstom.com> wrote: >in the C language, we have the variable __LINE__ to in,dicate to us the >value of the current line at ru...

command line commands passed to perl script?
Hi all, Sorry, should have added this to my last email. Does anyone know how to pass values to a perl script through the command line? Do you use param as in CGI scripting/ I want a user to be able to specify certain parameters for the perl script (in case they want to run an overnight scheduler on it). Eg. testscript.pl /? gives you help or testscript /a gives you another capability... Ben __________________________________ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ Nameofperlscript command1 command2 command3 Params s...

command-line commands within a Perl script
Hi, I have a directory with several subdirectories, each full of several dozen Word files. For each subdirectory, I need to run the checksum app against all of that directory's files and output a file into that directory with the checksum results. How can I do this? I'm very unfamilar with running command-line commands from within an Perl script. I know to change directories, you can do something like this: $changeDir = "cd ".$startingDir; system($changeDir); but what about retrieving the list of subdirectories from the starting directory? How can I do this? ...

Getting "Problem in Mapping Fragment starting at line ..." error when trying to create table mappings for table associations in ADO.NET Entity Framework
 Table A: COUNTRY_LOOKUP COUNTRY_ID   smallintclustered, unique, primary key located on PRIMARY    COUNTRY_ID TABLE B: COUNTRY_MODE_RULES CARRIER_ID    intMODE_RULE_TYPE_ID    intORIG_COUNTRY_ID    smallintDEST_COUNTRY_ID    smallint clustered, unique, primary key located on PRIMARY    CARRIER_ID, MODE_RULE_TYPE_ID, ORIG_COUNTRY_ID, DEST_COUNTRY_IDThere is a foreign key relationship from COUNTRY_MODE_RULES to COUNTRY_LOOKUPORIG_COUNTRY_IDREFERENCES .COUNTRY_LOOKUP (COUNTRY_ID)DEST_CO...

trying to get line-by-line output of a command pipe in perl
Hello; I'm trying to obtain line-by-line output from a command pipe in perl. Unfortunately, I am firmly held to 5.8.8 version of perl on this specific machine :-( Apparently, creating an array for my command prevents me from including the final pipe symbol when trying to use the three-argument form of open when using an array for my command rather than a scalar. code snippet #1: my @cmd = ("make", "target_name", "2>&1"); open my $fh, @cmd, "|" or die "blah: $!\n"; fails, "Unknown open() mode '5'&qu...

Getting Command line as is
Hi all, is it possible (and how) to get the command line as is, even if the parameters are separated by two or more spaces. "Colin Maharaj" <noreply@nohost.com> wrote in message news:374656@forums.embarcadero.com... > Hi all, > is it possible (and how) to get the command line > as is, even if the parameters are separated by > two or more spaces. Have you looked at the GetCommandLine() API function? http://msdn.microsoft.com/en-us/library/ms683156%28v=vs.85%29.aspx - Dennis No I did not, not until you told me but it is exactly what I wanted th...

Command line scripting
This question is about normal ASP, not ASP.Net. My question is can make ASP script to run it without any browser accessing the page (Command line scripting). I need this because I want to run ASP scripts regularly executed without any user requesting the page. Thanks for your time. you don't want ASP. you want WSH get the windows scripting docs : http://msdn.microsoft.com/scripting/ will append to this post when I get to work - got to rush now. jRTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unreadableJason Brown - MVP, IIS OK, back at th...

Getting Start With .net
hi i'm intersted to learn asp.net (vb or delphi) . i programming with delphi6 but i'd like to tp know something about programming in internet specially with .net . i hear about microsoft.net with delphi 7 that i can programming with delphi in .net .... is it right ? what 's our opinian about it ? and better to learn Vb.Net or continu with delphi(or delphi.net) thanks. Ali Darabian I think there is some support for Delphi in .Net. However, you will find much more support from the user community if you choose a more popular language such as VB.Net or C#. Since your al...

how to get start with .NET
the net help people installed  to my desktop 1-microsoft visual studio .NET enterprise developer 2003 2-microsoft .NET framework 1.1 what else do i need ...???  and how can i try with some simple code in VS.Net and run it to see wat happen...????? please help If you want to develope web applications, then you'll also need IIS on your PC.  That'll require XP-Professional or Windows 2000/2003, but XP-Home edition won't allow IIS installation. As for how to get started, you can search the web for some tutorials or buy a good book on VS.  The topic is way too vast to...

VS.NET and C# Compiler from command line "csc.exe" not fould when running from command prompt.
Hi All, I've been attempting to comlpile a custom control from the command line: I have VS.NET 2003 installed along with the .Net Framework 1.1 I've been working on a control project but cannot compile this into a .dll to register as a TagPrefix within an ASP.NET page. When going to the command prompt and typing csc /? it returns the ever popular error "csc" not recognized as an internal process or batch file. Is this a comman error? or a rogue install of VS.NET and/or the .NET Framework. Thanks In Advance, Tony If you open under Visual Studio .net Programs, the Vi...

Web resources about - command line scripts - asp.net.getting-started

Command - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Mercedes S-Cabrio commands 11 percent premium over coupe
Filed under: Mercedes-Benz , Car Buying , Convertible , Luxury Mercedes released pricing for the new S-Class Cabriolet in Europe, which tells ...

A rescue puppy is an internet star after learning to smile on command
... video that was viewed over 13 million times . The video was posted by Amanda Robles, his temporary foster owner. It shows him smiling on command, ...

Alabama Probate Judge Faces Conflicting Commands In Same-Sex Marriage Cases
A federal judge refuses to put an order striking down the state's ban on same-sex marriages on hold. Mobile County Probate Judge Don Davis now ...

North American Aerospace Defense Command Tracks Santa’s Flight « CBS New York
The North American Aerospace Defense Command is continuing its tradition of telling youngsters the location of Santa Claus on his annual storybook ...

Rescue puppy flashes "cheesy" grin on command
Video of American Staffordshire Terrier puppy smiling after being told to "Say Cheese" goes viral

IDG Contributor Network: Monkeying around on the bash command line in 2016
... quick-witted, optimistic, ambitious, etc. So, let's see what quick-witted, optimistic, ambitious things we can do to monkey around on the command ...

Germany’s Second In Command Denounces Saudi Funding Of Radical Islam Abroad
Germany’s Second In Command Denounces Saudi Funding Of Radical Islam Abroad

Officer who shot 12-year-old Tamir Rice claims he aimed for toy gun, gave verbal commands
... I was focused on the suspect," Loehmann wrote. "Even when he was reaching into his waistband, I didn't fire. I still was yelling the command ...

Disney Channel Commands Biggest Cable Crowd In Total Day For 2015
Disney Channel today boasted it had edged out Nickelodeon as the No. 1 ranked cable TV network in total viewers for total day for 2015. Disney ...

Resources last updated: 1/19/2016 8:15:38 AM