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

Discussion in 'ASP General' started by news.microsoft.com, Dec 9, 2003.

  1. 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
    news.microsoft.com, Dec 9, 2003
    #1
    1. Advertising

  2. > 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/
    Aaron Bertrand - MVP, Dec 9, 2003
    #2
    1. Advertising

  3. news.microsoft.com

    Ray at Guest

    "news.microsoft.com" <> wrote in message
    news:%...
    > 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
    Ray at, Dec 9, 2003
    #3
  4. thank everybody!
    now it is run marvellousy!
    bye.
    vilmar
    brazil

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> escreveu na mensagem
    news:...
    >
    > "news.microsoft.com" <> wrote in message
    > news:%...
    > > 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
    >
    >
    news.microsoft.com, Dec 9, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Siemel Naran

    Does true ^ true return false?

    Siemel Naran, Jun 17, 2004, in forum: C++
    Replies:
    19
    Views:
    660
    Chris Theis
    Jun 18, 2004
  2. Chip
    Replies:
    6
    Views:
    2,628
    E. Robert Tisdale
    Jan 8, 2005
  3. Andy Leszczynski
    Replies:
    4
    Views:
    327
    Erik Max Francis
    Oct 13, 2005
  4. bdb112
    Replies:
    45
    Views:
    1,334
    jazbees
    Apr 29, 2009
  5. Vilmar Brazão de Oliveira
    Replies:
    14
    Views:
    344
    Aaron Bertrand [MVP]
    Mar 5, 2004
Loading...

Share This Page