I would like to run a .bat file from a DFS drive that runs every time a user logs in a Pc on the network,
The file is on a server called file2 which is shared as everybody’s Y drive. I thought I can run this through a system policy and would like help with the correct syntax please.
Drive as said is the y drive on all users Pc and is as follows Y: \\FILE2\FIle2 DFS
and the bat file I want to run is below
if exist %systemdrive%\policy\it_policy1.szp goto end
if not exist %systemdrive%\policy\ goto next
net use y: /d
net use y: \\file2\file2 DNS
copy y:\it_policy1.szp %systemdrive%\policy
Regedit /s y:\it_policy1.reg
net use y: /delete goto end
Would this work or am I totally wrong?