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

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("WScript.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 6519
> 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*****@hitecnet.com.br> wrote in message
news:%2****************@TK2MSFTNGP10.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("WScript.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**************@TK2MSFTNGP09.phx.gbl...

"news.microsoft.com" <su*****@hitecnet.com.br> wrote in message
news:%2****************@TK2MSFTNGP10.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("WScript.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
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...
10
by: Vilmar Brazão 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 =...
14
by: Vilmar Brazão 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...
0
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...
11
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...
0
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...
9
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,...
4
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...
11
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...
0
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,...

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.