Task Scheduler: Mapping Network Drives

A lot of IT tools that provided from the internet are a key factors to automate a daily task on the running the application about the businesses transactions, windows or linux based application.

Mapping network drive is a system services to access the files from the servers. Mapping network drive has a tools to automatically run the map the network drive when the computer client is start whether log-in is executed or not. But there is a alternative way to map the network drive. Using scheduling tasks of a Windows and a little script code to automate and run the mapping of network drive. Here is the guide on how to do the mapping network drive using Scheduling Tasks and batch file script.


1.]  Here is a sample network drives that need to remap.

192.168.1.2/File-a  - for drive a
192.168.1.3/File-b  - for drive b
192.168.1.4/File-c  - for drive c


2.] Here is the script that will be run on a Windows platform.

a. Open a Notepad, type a script command below and save as task.bat and stored it in Desktop.

net use /delete a:
net use /delete b:
net use /delete c:

net use a: \\192.168.1.2\File-a /user:"" ""
net use b: \\192.168.1.3\File-b /user:"" ""
net use c: \\192.168.1.4\File-c /user:"" ""

exit

b. Meaning of command script.

* Net use /delete, means every time the computer is logoff, restart or shutdown and then open it again, the existing network map drive will be deleted and create another net map drive or re-mounted again.
* Net use - means they connects a computer to a shared resource or disconnects a computer from a shared resource.
* drive a, b, c are the drive that mounted settings from the server.
* The IP address are the server address shared folder.
* File-a, File-b, File-c are name of the shared folder.
* user: " " " ", means no username and password in the shared folder in the server.
* exit, means exit the window.

For more info, go to command and type net help use.

3.] Here is the settings of a Task scheduler and the implementing of script of a mapping drive with a filename task.bat

1. Go to Start menu and type Task Scheduler then click Task Scheduler.
2. Click the Create a Basic Tasks
3. Name a task whatever you want. But in this example, I will name it Netmaptask then click Next
4. In Trigger, click When I Log on, (so everytime the PC client is start on the log-in user, the script will run simultaneously.
5 In Action, click start a Program.
a. In Program/script, type cmd.exe
b. In Add arguments input box, copy this,  /c start /min "" "C:\Desktop\task.bat"
where start the command that the window are minimize during running the scripts.
c. Then Save, then Finish.
6. Restart the computer to test if the settings in Task Scheduler of network map drive is working. The output will create a map network drives.




0 comments:

Post a Comment