none
task scheduler file copy to mapped network drive

    Question

  • hi all,

    I have a situation here and I need help with it on windows server 2008 R RDS servers. it's really an application, but I am going to use a batch file scenario to make it easier to understand.

    let's say a user it scheduling a task to run a batch file that copys files from X: to Y: drive, and using UNC is not an option. if the user runs the task while logged in, all work fine, because the batch file finds the X: and Y: drive and runs the copy successfully.

    now the same user trys to schedule this task to run while not logged with the option of run when logged in or not selected, the task would try to run as scheduled, but the file copy fails, because the X: and Y: drives don't exist.

    so I am looking for a way that makes the file copy works between the 2 mapped network drives without the user being logged in.

    is this possible without using net use to mapped the drives first?

    Thanks


    Mohsen Almassud

    Tuesday, June 19, 2012 10:42 PM

Answers

  • I tried that and all drive mappings have the reconnect.

    so let me give you more details on this.

    we have a home written software that connects to the task scheduler API and creates the tasks for the users with the settings they desire. I was hoping that we can make such task work without having to use net use, but I found it extremely hard to this without it, so I ended up using by keeping it at the top of the actionstions.

    this way every time a user creates a task, the first action on it is net use "Drive Letter:" \\Server\Share, which the users cannot see or change, and that worked fine.

    Thanks


    Mohsen Almassud

    Wednesday, June 20, 2012 5:05 PM

All replies

  • The only thing I can think of is:

    the scheduled task runs as a specific user. that user would need to have drives that reconnect at logon. You would need to log into the server with that user profile and check that the drives are persistent (or "reconnect at login" is ticked when mapping the drive)

    Tuesday, June 19, 2012 11:20 PM
  • I tried that and all drive mappings have the reconnect.

    so let me give you more details on this.

    we have a home written software that connects to the task scheduler API and creates the tasks for the users with the settings they desire. I was hoping that we can make such task work without having to use net use, but I found it extremely hard to this without it, so I ended up using by keeping it at the top of the actionstions.

    this way every time a user creates a task, the first action on it is net use "Drive Letter:" \\Server\Share, which the users cannot see or change, and that worked fine.

    Thanks


    Mohsen Almassud

    Wednesday, June 20, 2012 5:05 PM
  • Hi,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.


    Regards,
    Clarence
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contacttnmff@microsoft.com.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.


    Monday, June 25, 2012 10:21 AM
    Moderator
  • Thanks a lot for your help.


    Mohsen Almassud

    Monday, June 25, 2012 3:52 PM
  • Hi Mohsen,

    For the issue, I think it depends on the application. Does it support creating the scheduled task to copy the file in one UNC path to another UNC path? If it doesn't and it only support coping the file in one drive letter to another drive letter, there isn't any better method to fullfill it without using net use command to map the drive to the UNC path.

    Best Regards

    Scott Xie

    Tuesday, June 26, 2012 9:50 AM