Creating a directory in a virtual disk

  • Hi!

    Made a virtual disk for my backups as:

    subst R: F:\BACKUP

    Try to make a directory with QA:

    EXEC master..xp_cmdshell 'mkdir R:\FULL'

    Get:

    output

    ---------------------------------------------------------

    The system cannot find the drive specified.

    (1 row(s) affected)

    (Have Windows 2000 Srv SP3 Eng + MS SQL 2000 SP3)

  • Even though you've done a subst, SQL doesn't know about your R: drive. You need to:

    EXEC master..xp_cmdshell 'subst R: F:\BACKUP'

    EXEC master..xp_cmdshell 'mkdir R:\FULL'


    Cheers,
    - Mark

  • This works fine, but I need to map this drive when computer is rebooted

    The procedure that has 'EXEC master..xp_cmdshell 'mkdir R:\FULL' command is part of a multiserver backup job (I need differnet substs for each server, like d:\backup, f:\backup, etc) 🙁

  • After some investigation, I found that if MSSQLSERVER logs on using Localsystem account, it works with this disk perfectly (no need to run EXEC master..xp_cmdshell 'subst R: F:\BACKUP') If it uses a domain accout (like in most working environments), then you need to run "EXEC master..xp_cmdshell 'subst R: F:\BACKUP'"... For a number of reasons this is not a choice... I even tried "run as cmd" with the same domain account to create vitual drive,- no way... 🙁

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply