Microsoft
Software
Hardware
Network
Question : Cannot access files from Mapped Drive when user not logged in windows 2003 system
I have batch script to display all the files in the mapped drive. The job is to delete the old files but to test it, I have created a script to list the files in the mapped drive. THis job is scheduled in the windows 2003 system. This job works fine when the user is logged into the system. But it does not work when the user is not logged in.
The batch script is:
::ListDBFiles.bat -- this shell script will list the database daily backup files from L: drive.
::
@echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
echo execution of ListDBFiles.bat started %date%-%time% >> E:\DBBackups\LOGS\ListDBFi
les.log
net use L: \\ServerName\DBBackups persistance=no
L:
cd \
for %%F in (*.*) do (
echo ***** %%~nxF Exist in L:\ >> E:\DBBackups\LOGS\ListDBFi
les.log *****
)
echo execution of ListDBFiles.bat ended %date%-%time% >> E:\DBBackups\LOGS\ListDBFi
les.log
E:
net use L: /delete
exit
The log file output is:
Successful Execution - when logged in the system, batch job run by windows scheduler.
execution of ListDBFiles.bat started Fri 09/07/2007-11:34:42.76
***** _backup_200708300018.bak Exist in L:\ *****
***** _backup_200708310018.bak Exist in L:\ *****
***** _backup_200709010018.bak Exist in L:\ *****
***** _backup_200709020018.bak Exist in L:\ *****
***** _backup_200709030018.bak Exist in L:\ *****
***** _backup_200709040018.bak Exist in L:\ *****
execution of ListDBFiles.bat ended Fri 09/07/2007-11:34:43.01
Unsuccessful Execution - when logged in the system, batch job run by windows scheduler.
execution of ListDBFiles.bat started Fri 09/07/2007-11:40:00.18
execution of ListDBFiles.bat ended Fri 09/07/2007-11:40:00.23
execution of ListDBFiles.bat started Fri 09/07/2007-11:45:00.15
execution of ListDBFiles.bat ended Fri 09/07/2007-11:45:00.17
I tried with both persitance=no and persistance=yes. But it is not working.
At present, I am executing this job manually. Please let me know where I am going wrong.
Thanks
Sri
Answer : Cannot access files from Mapped Drive when user not logged in windows 2003 system
HyperData,
net use l: \\servername\dbbackups password /user:domain\username /persistance=no
sometime, if you dont put the domain name it will not work either..
hope that help
Random Solutions
What could cause the amount of time to save a file go from 1 second to 20 seconds, every day starting at 1pm?
doubt in configuring VTP transparent switch
sp_spaceused
Running g++ on AIX 5.2.0.0
Positioning dynamic text fields in a 9-slice movie clip [example attached]
Solaris 7 "no shell" on root, su not working, su parameters for shell?
opening browser window with only title bar & standard toolbar
Block BlackBerry Access in Exchange
Multiple choices when filtering column
SMTP Timeout From MX Gateway But Only For Some Domains