Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > objWshell.run "%COMSPEC% /C d:\rd teste", 0, TRUE ????

Reply
Thread Tools

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

 
 
news.microsoft.com
Guest
Posts: n/a
 
      12-09-2003
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


 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      12-09-2003
> 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/


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      12-09-2003

"news.microsoft.com" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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


 
Reply With Quote
 
news.microsoft.com
Guest
Posts: n/a
 
      12-09-2003
thank everybody!
now it is run marvellousy!
bye.
vilmar
brazil

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> escreveu na mensagem
news:(E-Mail Removed)...
>
> "news.microsoft.com" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[False,True] and [True,True] --> [True, True]????? bdb112 Python 45 04-29-2009 02:35 AM
TurboGears /.-ed, >new == True< or >new == "True"< Andy Leszczynski Python 4 10-13-2005 06:56 AM
C and C++ are interoperable languages? True or Not True? Chip C++ 6 01-08-2005 11:10 PM
Does true ^ true return false? Siemel Naran C++ 19 06-18-2004 11:06 AM
objWshell.Run "%COMSPEC% /C ren topoX.jpg topo_cliente.jpg", 0, TRUE ??? Vilmar Brazão de Oliveira ASP General 14 03-05-2004 08:01 PM



Advertisments