0

Due to the uselessness of the IT team in my place of work, I have written a small batch file for the people in my department to map a network folder to a drive letter since the network path is too long and Windows will not allow us to open any files in that folder or any of it's subfolders. I have the batch file on my memory stick since our e-mail system blocks batch files, reading them as malicious so I can't e-mail it to everyone. This is the only thing on my memory stick that I will need to open/run while at work so I was wondering:

Is it possible to make the autorun.inf only run when connected to a certain domain or workgroup?

2
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by Borzoi
0

Try this conditional batch.

echo off
if %username% == somename net use x: \\server\share

You will have to add an if statement for each user. I cannot figure out how to find domain from vars, but usernames have similar effect.

Edited by kendrick.ryan: n/a

0

That should work, it would just mean the batch file is longer than I originally thought.

Just one question:

Is the username case sensitive?

0

Here is a simple test.

echo off
if %username% == BoRzOi echo isnt case sensitive
pause

Replace BoRzOi with the real username in the same case format.

-Ryan

Edited by kendrick.ryan: n/a

0

I know how to test it but I can't until I get into the office which is why I asked if anyone knew. I can't get into the office today due to snow because the bus company here sees snow and thinks "We can't go on!" like it's a perilous journey.

0

I know how to test it but I can't until I get into the office which is why I asked if anyone knew. I can't get into the office today due to snow because the bus company here sees snow and thinks "We can't go on!" like it's a perilous journey.

any luck?

0

The batch file works but I forgot to test the case sensitivity. I'm going to mark this thread as solved but I'll post the results in here when I've tested it; which should be tomorrow but don't quote me on that.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.