Computing.Net > Forums > Windows 2000 > Batch File and net use help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File and net use help

Reply to Message Icon

Name: ChrisRT
Date: March 16, 2004 at 02:45:02 Pacific
OS: 2000
CPU/Ram: Variable
Comment:

Hi,

I'm trying to work out if i can use a batch file to delete mapped drives if a certain condition is met, namely the computer name. I'm a bit clueless, but i thought something like the following might work.

IF %computername%=="Satellite?" net use /delete f:

This doesn't work unfortunately but helps to give an idea what i'm trying to do. Anyone know if its possible? Any suggestions?

Chris



Sponsored Link
Ads by Google

Response Number 1
Name: Rambler
Date: March 16, 2004 at 04:42:19 Pacific
Reply:

Leave out the quotes.


0

Response Number 2
Name: ChrisRT
Date: March 16, 2004 at 04:52:27 Pacific
Reply:

Thanks Rambler, works now but am i able to put wildcards in the computer name any way? Can't seem to get it to work if i do.

Chris


0

Response Number 3
Name: IVO
Date: March 16, 2004 at 06:45:18 Pacific
Reply:

No, you can't use wildcards in comparing variables. However you can work around so:

If %ComputerName:~0,9%==Satellite ...

that compares the first nine chars of the name; other tricks like this can be adopted, but it is a quite complex issue.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: Batch File and net use help

Remove network printer/ batch file www.computing.net/answers/windows-2000/remove-network-printer-batch-file/46587.html

Batch Files and Services www.computing.net/answers/windows-2000/batch-files-and-services/18234.html

Batch file www.computing.net/answers/windows-2000/batch-file/32831.html