Page 1 of 1 1
Topic Options
#153957 - 2005-12-22 11:40 PM RD from Shell
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
I'm trying to Shell the RD command but it doesn't function the way I am expecting. My code is simple:
Code:
SHELL 'RD /S /Q "\\server\apps1$\test"'


Why won't that code work? I get an error #2 "The system cannot find the file a specified.

Yet I copy out the command from my script and paste into cmd line and it works great. Not sure what I'm doing wrong here.

I saw some posts on the beta board about the RD in kix. Hope that gets revamped soon.

Top
#153958 - 2005-12-22 11:57 PM Re: RD from Shell
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Try adding the comspec var :

Code:
 SHELL '%comspec% /c RD /S /Q "\\server\apps1$\test"' 


Top
#153959 - 2005-12-23 12:05 AM Re: RD from Shell
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Thanks. Didn't even think I'd have to use that. It's working fine now.
Top
#153960 - 2005-12-23 01:03 AM Re: RD from Shell
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Quote:

Thanks. Didn't even think I'd have to use that. It's working fine now




That is one of the many built-in features of Windows command interpreter.


The following are all of the Windows NT internal commands:

  • ASSOC
  • CALL
  • CHDIR/CD
  • CLS
  • COLOR
  • COPY
  • DATE
  • DIR
  • DPATH
  • ECHO
  • ENDLOCAL
  • ERASE/DEL
  • EXIT
  • FOR
  • FTYPE
  • GOTO
  • IF
  • MKDIR/MD
  • MOVE
  • PATH
  • PAUSE
  • POPD
  • PROMPT
  • PUSHD
  • REM
  • RENAME/REN
  • RMDIR/RD
  • SET
  • SETLOCAL
  • SHIFT
  • START
  • TIME
  • TITLE
  • TYPE
  • VER


Further reading:
http://www.microsoft.com/technet/archive/winntas/deploy/shellscr.mspx
 
 

Top
#153961 - 2005-12-23 01:08 AM Re: RD from Shell
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Thanks for clarifying that for me NTDOC. I think this is the first time I shelled out an internal command like that. I usually just use kix version, but RD is a bit lacking as you know of course.

Thanks again.

Top
#153962 - 2005-12-23 02:02 AM Re: RD from Shell
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Yes, but the just released 4.52 beta 1 now has support for RD /S to properly remove everything.

Give it a go and let us know how it goes.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 476 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.059 seconds in which 0.029 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org