Page 1 of 1 1
Topic Options
#29260 - 2002-09-18 09:25 PM Redirect Output
Michael Anthony Offline
Fresh Scripter

Registered: 2002-09-03
Posts: 5
Loc: Chicago, IL
Hello,

I'm sure there are a few ways to do this. I want to delete two drives when a client first logs in, but I don't want them to see error messages if the drives don't exist. I inserted the following into my script:

shell "net use k: /delete > NUL"

This gives me an error message every time. How can I either redirect the error to null or check for the existance of the drive letters before I try to delete them.

Thanks a lot.

Top
#29261 - 2002-09-18 09:26 PM Re: Redirect Output
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Review the manual for the abilities of the USE command.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#29262 - 2002-09-18 09:38 PM Re: Redirect Output
Michael Anthony Offline
Fresh Scripter

Registered: 2002-09-03
Posts: 5
Loc: Chicago, IL
That will not work because if USE fails, I can't redirect that to NUL either.
Top
#29263 - 2002-09-18 09:41 PM Re: Redirect Output
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
USE does not print anything to the screen when it fails. Have you tested?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#29264 - 2002-09-18 10:11 PM Re: Redirect Output
Michael Anthony Offline
Fresh Scripter

Registered: 2002-09-03
Posts: 5
Loc: Chicago, IL
Oops,

Sorry about that...Looks like I'm good to go. Thanks for your help.

Top
#29265 - 2002-09-18 10:26 PM Re: Redirect Output
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You test for success/fail of USE by checking the @ERROR macro like:
code:
use x: '\\sever\share'
if @ERROR
? ''+@ERROR+' - '+@SERROR
else
? 'Success'
endif

_________________________
There are two types of vessels, submarines and targets.

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 1808 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.059 seconds in which 0.03 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