Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 10th, 2011, 05:10 AM
Authorized User
Join Date: Sep 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default Error for Special char in a string


I have a problem to pass the character "/" in a string.

I have to use this command line:
taskkill /IM calc.exe

And I receive an error because the webpage with IIS cannot recognize the special character "/"

Set Wshell = Server.CreateObject("WScript.Shell")
Wshell.Run("""d:\Program Files\taskkill /IM calc.exe""") <--- NO GOOD !!!
Set Wshell = Nothing

I have tried to use this way but with no result:
Wshell.Run("""d:\Program Files\taskkill """& chr(47) &"""IM calc.exe""")
Thanks in advance !!!
Reply With Quote
  #2 (permalink)  
Old February 16th, 2011, 05:41 AM
Authorized User
Join Date: Sep 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts

I have solved the problem with the help of my friend ...

There were two mistakes:

1. It must be set to LOW the level of PROTECTION of the IIS in which there is the webserver intranet

2. it was a bad path of taskkill; under, there is the correct path:

<%@ Language=VBScript %>
Option Explicit
Dim shell
Set shell = Server.CreateObject("WScript.Shell")
shell.Run "c:\windows\system32\taskkill /IM calc.exe" <-- OK !!
Set shell = Nothing
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
special char to stored procedure parameters hem969 SQL Language 2 May 29th, 2007 11:40 AM
char[...] or string.charAt(...) Ibn_Aziz Java Basics 1 June 14th, 2006 07:08 PM
getting the last CHAR of a string kondapally Crystal Reports 0 December 13th, 2004 03:39 PM
Replace or remove the last char from the string sabu21s XSLT 12 January 8th, 2004 05:26 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.