I would like to know if somebody knows a walk round to the issue where task scheduler wont execute a batch on a shared directory.
The only way I know is to create one with username and password access however because I don’t have these details of any of the 17 pc I maintain (user privacy) I have to find another way IF I run the task with the system rights it wont run the batch located on a shared directory.
I have also tried to see if a shortcut linked to the batch might trick the system or if a batch calling the original batch on these hared directory might work but either has failed.
I assume that by a “shared directory” you mean a network share, like
//server/c/directory/whatever.Batch files have issues with network shares because you cannot make a network share your current directory because current directories require a drive letter for some reason. You can access data and even programs and batch files on a network share, but you cannot run a batch file in a network share.
What you need to do is map a network drive to a drive letter. You can use the
net usecommand to do so from the command prompt or a batch file. Allowing the automatic connections to be created and destroyed only when needed. Permanent connections are problematic over WiFi because Windows will probably try (and fail) to reconnect them before you’ve even gotten an IP address.So, an example would be:
Line 1 will only reliably work if
\\Linda-PC\c\Downloadsrequires no username or password. If\\Linda-PC\c\DownloadsDOES need a username and password it may prompt you for them, it may simply fail, or it may appear to connect but be unable to read any files or directories. (Unless you are using a username with the same domain and password on both PC’s. Like a network administrator.)Line 2 will only work if you have a username and password on that PC (Unless you have a user with the same domain, username, and password on both PC’s.) If you are using and login to an account that has the same domain, username and password on both PC’s, it will not ask for your password.
Line 3 will only work if you have a username and password on that PC (Unless you have a user with the same domain, username, and password on both PC’s.).
It is possible to browse and use any subdirectories off your mount-point, though you may need to propagate the permissions throughout them, or you may set user access by Group or by User for every individual directory. Hidden files and folders will be hidden unless you have permission to see them, but still only when using the
dir /a:hcommand. Normal file and folder attributes may be set and eliminated byATTRIB.EXE.You may connect many different drive letters to many different mount-points on the same machine and give them all the same, or different, sets of user rights and requirements.
So you may Connect: To:
So under the right circumstances (Windows 7 has made user rights and permissions more complicated), drive
W:(or\\Linda-PC\c) could have access to the entire C: drive ofLinda-PC, but be limited in access to members of the Administrator’s Group onLinda-PC.Drive
X:or network share\\Linda-PC\c\Downloads, you could giveReadaccess to the groupEveryone, eliminating the need for using a username or password when connecting, browsing, or downloading files.Drive
Y:, or\\Linda-PC\c\Users\Johnyou could giveFull-Controlaccess to the userJohnfrom `Linda-PC’.And Drive
Z:or\\Linda-PC\c\Users\Public\Documentsyou could give read/write access to the Group Guests, and limit access to those who have an account in the groupGuestsonDansPc.All these permissions must be set up on the machine hosting or serving the files, and to give access to groups or users that do not have an account on the
SERVER, that server must have Administrative network access to the other machine. So you could hook up the userDansPC\Danwith access to driveY:, butDansPcandLinda-PCmust be able to talk, and simultaneously have a user logged in or connected to both machines with Administrative access to both.