question about net use


  1. Posts : 18
    Windows 7 Home Premium 32bit
       #1

    question about net use


    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:myname@mymail.com /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


  2. Posts : 120
    Win7Ultimate x64 + x32, Win7Pro x64, XP x32, Win 2003, Ubuntu and OpenIndiana
       #2

    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


  3. Posts : 18
    Windows 7 Home Premium 32bit
    Thread Starter
       #3

    Thank you for providing the information. The problem is that is about a server, most time no one logon.
      My Computer


  4. Posts : 120
    Win7Ultimate x64 + x32, Win7Pro x64, XP x32, Win 2003, Ubuntu and OpenIndiana
       #4

    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


  5. Posts : 18
    Windows 7 Home Premium 32bit
    Thread Starter
       #5

    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


  6. Posts : 120
    Win7Ultimate x64 + x32, Win7Pro x64, XP x32, Win 2003, Ubuntu and OpenIndiana
       #6

    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


  7. Posts : 18
    Windows 7 Home Premium 32bit
    Thread Starter
       #7

    Great idea! I'll try it.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:46.
Find Us