473,497 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using Shell command in ASP.Net

RJN
Hi

I'm trying to create a windows task through code. I could do this
through the shell command and the WMIService in .net exe. But the same
doesn't work from asp.net. Any idea? This is the code

--WMI
strComputer = "."
objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
objNewJob = objWMIService.Get("Win32_ScheduledJob")
objNewJob.Creat("C:\test.exe", "********200000.000000+330", False, , ,
False, iRet)

--Shell
Shell("AT 19:00 /every:13 C:\test.exe")

Regards

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
3 3052
Are you trying to shell to start an external file? If so, check out

Process.Start Method

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

Ken
"RJN" wrote:
Hi

I'm trying to create a windows task through code. I could do this
through the shell command and the WMIService in .net exe. But the same
doesn't work from asp.net. Any idea? This is the code

--WMI
strComputer = "."
objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
objNewJob = objWMIService.Get("Win32_ScheduledJob")
objNewJob.Creat("C:\test.exe", "********200000.000000+330", False, , ,
False, iRet)

--Shell
Shell("AT 19:00 /every:13 C:\test.exe")

Regards

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
And take care of security.

Eliyahu

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:63**********************************@microsof t.com...
Are you trying to shell to start an external file? If so, check out

Process.Start Method

http://msdn.microsoft.com/library/de...starttopic.asp
Ken
"RJN" wrote:
Hi

I'm trying to create a windows task through code. I could do this
through the shell command and the WMIService in .net exe. But the same
doesn't work from asp.net. Any idea? This is the code

--WMI
strComputer = "."
objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
objNewJob = objWMIService.Get("Win32_ScheduledJob")
objNewJob.Creat("C:\test.exe", "********200000.000000+330", False, , ,
False, iRet)

--Shell
Shell("AT 19:00 /every:13 C:\test.exe")

Regards

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3
True

"Eliyahu Goldin" wrote:
And take care of security.

Eliyahu

"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:63**********************************@microsof t.com...
Are you trying to shell to start an external file? If so, check out

Process.Start Method

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

Ken
"RJN" wrote:
Hi

I'm trying to create a windows task through code. I could do this
through the shell command and the WMIService in .net exe. But the same
doesn't work from asp.net. Any idea? This is the code

--WMI
strComputer = "."
objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
objNewJob = objWMIService.Get("Win32_ScheduledJob")
objNewJob.Creat("C:\test.exe", "********200000.000000+330", False, , ,
False, iRet)

--Shell
Shell("AT 19:00 /every:13 C:\test.exe")

Regards

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #4

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

Similar topics

5
14386
by: Ayesha Ahsan | last post by:
Hi, I use Runtime.getRuntime().exec(command) to make my system call. For Windows based Dos, i add "cmd /c" before I type in my system call. So for example make the system call "dir": String...
4
9867
by: Kartik | last post by:
Hi, I have an ASP.NET application using VB.NET.I am sending a DOS command to a machine on the network to print a file. This is achieved using xp_cmdshell Dim str As String = "xp_cmdshell...
8
1333
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland...
2
6654
by: micahstrasser | last post by:
I have been trying for days to send a command to the command prompt through the shell() function in vb.net. For some reason it is not working. Here is the code: Private Sub Button1_Click(ByVal...
4
8032
by: RLN | last post by:
Re: Access 2003/WinXP Pro-SP3 I have a shell command that does not run correctly. I have two programs located on a file server: Pgm1.mdb and Pgm2.mdb Pgm1 launches Pgm2 via a command button...
4
4741
by: ohaqqi | last post by:
Hi everybody. I haven't programmed anything in about 8 years, I've read up a little bit on C and need to write a shell in C. I want to use strtok() to take an input from a user and parse it into the...
1
8212
by: ohaqqi | last post by:
Hi guys, I'm still working on my shell. I'm trying to implement a function typefile that will take a command line input as follows: > type <file1> This command will implement a catenation of...
0
3433
by: Cameron Simpson | last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote: Because $HOSTNAME is a bash specific variable, set by bash but NOT EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses...
3
6715
by: Max Vit | last post by:
I have come across a strange issue whilst trying to use a shell command call from Access and have spent some time trying to figure this out but can't find the cause as yet. The issue is: I need...
7
6199
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
6991
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
7160
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
7196
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...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.