473,689 Members | 2,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

objWshell.run "%COMSPEC% /C d:\rd teste", 0, TRUE ????

Hi folks,

I got samples on http://www.aspfaq.com/show.asp?id=2059 and runs ok to dir
ms-dos command, but to others commands like del, rd, deltree, etc... it has
not had any effect, even it has not returned errors.
ANY secret??
Using batch file is possible, but and using "%COMSPEC% /C ??
I read all help from ms-dos to "%COMSPEC% , but untill now I could not find
solution!
thanks!

Set objWshell = CreateObject("W Script.Shell")

objWshell.run "%COMSPEC% /C d:\rd teste", 0, TRUE '换it has no effect.
objWshell.run "%COMSPEC% /C dir *.txt d:\ > d:\dir.txt", 0, TRUE '换here
runs OK

Set objWshell = nothing
Jul 19 '05 #1
3 6540
> I got samples on http://www.aspfaq.com/show.asp?id=2059 and runs ok to dir
ms-dos command, but to others commands like del, rd, deltree, etc... it has not had any effect, even it has not returned errors.


Probably a permissions issue. Try forcing windows authentication in IIS,
and authenticating against the web page with credentials of a user that has
the ability to do those things, and see if the results are different.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #2

"news.microsoft .com" <su*****@hitecn et.com.br> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi folks,

I got samples on http://www.aspfaq.com/show.asp?id=2059 and runs ok to dir
ms-dos command, but to others commands like del, rd, deltree, etc... it has not had any effect, even it has not returned errors.
ANY secret??
Using batch file is possible, but and using "%COMSPEC% /C ??
I read all help from ms-dos to "%COMSPEC% , but untill now I could not find solution!
thanks!

Set objWshell = CreateObject("W Script.Shell")

objWshell.run "%COMSPEC% /C d:\rd teste", 0, TRUE '换it has no effect.
With that line, you aren't doing anything. If you want to rd a directory,
use "rd D:\teste."

objWshell.run "%COMSPEC% /C dir *.txt d:\ > d:\dir.txt", 0, TRUE '换here


That line will execute two separate dir commands. One for *.txt and one for
D:\. Is that what you want? Or do you really want:

dir D:\*.txt

After you get the probable permissions issues fixed as Aarons suggested, you
should delete the spaces before and after the > redirect character.

D:\*.txt>D:\dir .txt

for example.

Ray at work
Jul 19 '05 #3
thank everybody!
now it is run marvellousy!
bye.
vilmar
brazil

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> escreveu na mensagem
news:uV******** ******@TK2MSFTN GP09.phx.gbl...

"news.microsoft .com" <su*****@hitecn et.com.br> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi folks,

I got samples on http://www.aspfaq.com/show.asp?id=2059 and runs ok to dir ms-dos command, but to others commands like del, rd, deltree, etc... it has
not had any effect, even it has not returned errors.
ANY secret??
Using batch file is possible, but and using "%COMSPEC% /C ??
I read all help from ms-dos to "%COMSPEC% , but untill now I could not

find
solution!
thanks!

Set objWshell = CreateObject("W Script.Shell")

objWshell.run "%COMSPEC% /C d:\rd teste", 0, TRUE '换it has no effect.


With that line, you aren't doing anything. If you want to rd a directory,
use "rd D:\teste."

objWshell.run "%COMSPEC% /C dir *.txt d:\ > d:\dir.txt", 0, TRUE

'换here
That line will execute two separate dir commands. One for *.txt and one for D:\. Is that what you want? Or do you really want:

dir D:\*.txt

After you get the probable permissions issues fixed as Aarons suggested, you should delete the spaces before and after the > redirect character.

D:\*.txt>D:\dir .txt

for example.

Ray at work

Jul 19 '05 #4

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

Similar topics

2
4419
by: Hal Vaughan | last post by:
I know that I need to launch a VBS file on Windows this way: Win9x: Runtime.getRuntime().exec("start script.vbs"); WinNT: Runtime.getRuntime().exec("cmd /c start script.vbs"); I'm doing this, and verifying what the command line looks like before I try
10
7435
by: Vilmar Braz鉶 de Oliveira | last post by:
HI people, what is wrong in the code bellow to kill iexplore.exe process after processing my page?? '换Before comes routines to access data base and to send email. Set objWshell = Server.CreateObject("WScript.Shell") objWshell.Run "%COMSPEC% /C kill iexplore.exe", 0, TRUE VILMAR BRAZIL
14
6643
by: Vilmar Braz鉶 de Oliveira | last post by:
Hi all, I was using: <% Set objWshell = Server.CreateObject("WScript.Shell") objWshell.Run "%COMSPEC% /C ren topoX.jpg topo_cliente.jpg", 0, TRUE %> BUT the comand COMSPEC disapeared of all my machines which we have ms-windows 2000 installed! So now no-one machine can continue run my routines which accessed ms-dos by ASP
0
1979
by: huobazi | last post by:
I have many dropdownlist controls in my ascx (and use LoadControl in a aspx fiel) file,so i write a method "InitList(DropDownList list,string strsql,string TextField,string ValueField)" but when i want to get the BigClassList.SelectedItem.Text and BigClassList.SelectedItem.Value in a button onclick method,btnSmallClassEdit_Click(....),there post an error " System.NullReferenceException: 未将对象引用设置到对象的实例。", I Don't know the...
11
2787
by: zsolt | last post by:
Hi, I'm trying to convert a string to date by specifying the format. The value is like this: "03rd of April 2006". Now this is converted fine by using the following format: "dd\r\d \o\f MMMM yyyy". The problem is of course that the string can be 01st of..., 04th of etc., meaning that I can't use the "\r\d" format description for all possible values. Any suggestions? Is there a wildcard i can use, like "dd\?\?"...
0
2685
by: edurran | last post by:
Hi all, I have spent the last three days on this problem. Looked in many forums and not found the answer as yet. Hopefully ye can help. I have two functions. One works fine, the second does not. First Function Function try1 SET objShell = CreateObject("Wscript.Shell")
9
1818
by: jaynemarie | last post by:
I have a simple program that attempts to convert lines to a csv file. The way I see it it shoule output like this: Applebee's Neighborhood Grill & Bar*, 11500 Shawnee Mission Pkwy.,Shawnee, KS, 66203, 913-962-1133 as one line. But it is not and I don't see why. I am putting each line into an array and then at the end doing a join. Why am I getting a newline after the company name and then again after the street address? As an...
4
1903
by: mpatharkar | last post by:
Hi all, I wrote a script to search a pattern in input file and if pattern does not found in input file ,print that pattern in to output file. The input file is -------------------------------------------------------- 1999-1011籄ll the flowers of tomorrow are in the seeds of today. 2000-1209籌 saw this article posted on another site and wanted to share it with everyone at TSDN. Please read this article and post your thoughts....
11
6894
by: Ahmedhussain | last post by:
hey everyone... I have a code which gives me this error. Error : Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on. I am actually populating a user control dynamically. And the problem arises when i try to populate it with values. and the code runs again after 30 or more seconds to get updated values and so on.. The code is given below This is actually the user control...
0
8598
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抣l explore What is ONU, What Is Router, ONU & Router抯 main usage, and What is the difference between ONU and Router. Let抯 take a closer look ! Part I. Meaning of...
0
8951
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
8786
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
8793
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6457
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5811
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
4322
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...
2
2225
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1952
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.