question about net use

datactrl

New member
Local time
4:44 AM
Messages
18
I have a batch file as the following:
---
@echo off
start /B net use t: /delete
start /B net use t: https://dav.z.com password /USER:[email protected] /persistent:no
---
I set up a task on task schedule to run it. If I let it run after user log in, it works fine. If I let it run whether user log in or not, it completed but nothing happened even highest privilege is ticked.
 

My Computer

OS
Windows 7 Home Premium 32bit
You can't get there from here. :)

Drive mappings are account and logon specific. When NET USE is run by the task scheduler and no user it logged on, the drive will be mapped for whatever account the task scheduler used to run the command. This will be a system account.

If you want to map drives on every logon, put the batch file in a login script, in the all users component of the startup folder, or in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.
 

My Computer

OS
Win7Ultimate x64 + x32, Win7Pro x64, XP x32, Win 2003, Ubuntu and OpenIndiana
Thank you for providing the information. The problem is that is about a server, most time no one logon.
 

My Computer

OS
Windows 7 Home Premium 32bit
Can you say what you're trying to do? Are you running some unusual software that runs as a service but can't use UNC paths and needs to see a mapped drive...or?

There's probably some way to do what you want if you can spell out what you need.
 

My Computer

OS
Win7Ultimate x64 + x32, Win7Pro x64, XP x32, Win 2003, Ubuntu and OpenIndiana
Just a normal backup desktop application. I would like to backup directly to a remote webdav server. A webdav server cannot become a UNC.
 

My Computer

OS
Windows 7 Home Premium 32bit
How is the backup app started? Does somebody login and start it or does it get triggered by the task scheduler? If you're using the task scheduler, net use should (I think) work if you use a batch file that maps your drives and then launches the backup program. All bets are off if the backup program impersonates another user after it's started, however.
 

My Computer

OS
Win7Ultimate x64 + x32, Win7Pro x64, XP x32, Win 2003, Ubuntu and OpenIndiana
Great idea! I'll try it.
 

My Computer

OS
Windows 7 Home Premium 32bit
Back
Top