Link to home
Start Free TrialLog in
Avatar of lozzamoore
lozzamooreFlag for United Kingdom of Great Britain and Northern Ireland

asked on

hiding output in batch file-can't find ctty?

I wish to suppress output from a series of net use commands at logon for the users. As I use net use x: /del just in case a drive is already mapped, the output goes to standard error and cannot be suppressed using > nul.

Should be able to use ctty nul and then ctty con after, but can't find ctty command in NT (supposed to be internal?!)

Where is it?

Thanks
Avatar of Tim Holman
Tim Holman
Flag of United Kingdom of Great Britain and Northern Ireland image

NET USE to the share first, then delete it.
That's the way thousands of NT administrators around the world do this !
Avatar of lozzamoore

ASKER

Don't really understand what you mean.

Say I want to remap the P: drive, and don't know if it is in use or not?

How should I do it?

Thanks,
Drives will only come up if they've been made persistent.
In the logon script, run net use /d, and net use x: \\server\share /persistent:no for a few weeks, then that way, the drive mappings will no longer return in your script and give you these errors.
ASKER CERTIFIED SOLUTION
Avatar of saurabh_dasgupta
saurabh_dasgupta
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Comment accepted as answer
That is exactly what I want. Thanks.