in
Support Center

Command line in advanced options does not execute

Last post 08-01-2008 1:19 PM by Nate. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-28-2008 12:12 PM

    Command line in advanced options does not execute

    I am running SP on a Vista basic laptop and backing up to an old XP machine I am using as a server with several USB drives attached to it. 

    I have a batch file with four XCOPY commands in it.  When I run the batch file in a RUN command or as a DOS command line, all four commands work perfectly.  When I execute the commands as a pre-snapshot command file, it skips past the command with an error (It is a 505 error).  Is there some issue I need to be aware of?  The manual does not indicate that there should be a problem in just running the batch file just as I would in a DOS window.

    I just read some other posts about this same type of problem.  It looks like you need to add credentials.  I know SQUAT about credentials and would appreciate someone who knows what to do here to SPELL IT OUT LINE BY LINE so I can just copy it into my batch file. 

     

    OK.  Here are all the details. 

    System:  Vista Home Basic on a Dell D830 laptop

    ShadowProtect Version:  3.2.0.2

     

    Details of problem:

    I ran the batch file (containing 4 XCOPY commands shown below) in the advanced options/commands presnapshot box.  I have tested this batch file and it works without a hitch if I call it directly. It does not work in your commands box. 

     

    The “Semsim 4 & Techon backup.bat” (shown in the command line in ShadowProtect) contains these commands:

    xcopy c:\users\eganders\documents\"SEMSIM 4"\*.* \\officepc\owner\"my documents"\"SEMSIM 4" /D /S /C /R /K /Y

    xcopy c:\users\public\"techon inc"\*.* \\officepc\shareddocs\"techon inc"   /D /S /C /R /K /Y

    xcopy \\officepc\owner\"my documents"\"SEMSIM 4"\*.* c:\users\eganders\documents\"SEMSIM 4"  /D /S /C /R /K /Y

    xcopy \\officepc\shareddocs\"techon inc"\*.* c:\users\public\"techon inc"  /D /S /C /R /K /Y

      

    This is what ShadowProtect Desktop command detail shows:

     

    27-Jul-2008 08:29:18        service  100         service (build 42) started job manually as full

    27-Jul-2008 08:29:18        service  104         3.2.0.2 DAF7-AC25 434F-C383-4557-DA6F

    27-Jul-2008 08:29:18        service  100         backup volume C:\ (NTFS)

    27-Jul-2008 08:29:18        service  105         external command "C:\Users\eganders\AppData\ShadowProtect batch files\Semsim 4 & Techon backup.bat" started

    27-Jul-2008 08:29:18        service  505         External command completed with error The system cannot open the file. 0x4(4)

    27-Jul-2008 08:29:18        service  102         creating snapshot for  \\?\Volume{fdeed328-3c67-11dd-a455-806e6f6e6963}

     

    I think this is another problem about rights, but please let me know what I have to do to run this AND please explain the philosophy.  A quick glance in your forums suggests that I am not the only one with a problem with this.  The manual apparently presents it much too simplistically.

     

  • 08-01-2008 1:19 PM In reply to

    Re: Command line in advanced options does not execute

    Yup, you're right, this is a credentials issue.  Credentials are just the user name/password necessary to access something.  In this case, you have a script which accesses a network share (\\officepc\shareddocs) which works when you run it yourself, but doesn't work when the service (ShadowProtectSvc.exe) runs it as part of the backup job.  The reason for this is that every process (application that is running) runs under the context of some "Logon Session."  In a simplified way you can just think of a Logon Session as being some username and password that get associated with a running application.  Now, whenever you personally run some program (be it your script, or some application that you launch from the Start menu, or from the Run dialog or from the cmd.exe shell), that new program or script will run under your own logon session, meaning that it will run with access to everything to which your username/password has access.  Now, ShadowProtectSvc.exe, as an NT Service, by default is installed such that it will run under the "Local System" logon session.  This means that when ShadowProtect accesses files/directories/etc, it can only access things for which the "Local System" account has access.  Like any NT Service, you can (using services.msc) change the account under which ShadowProtectSvc.exe runs.  For instance, you could make it run using the credentials of a user that DOES have access to that share.  If you do this, then you must make sure that you also add that user to your local computer's Administrators group, otherwise the service won't be able to backup your volumes.  Alternatively, you could just leave the service's account as it is (as "Local System") and just add a statement to your script that causes it to properly connect to the network share before attempting to use it.  The drawback of that technique is that you must specify username/password values within your script.  For instance, if a valid user and password combo for accessing (for read/write) the share \\officepc\shareddocs is JoesDomain\JoesUserName with password JoesPassword then you could add the following statement to your .cmd script and it would work (without the need to change the ShadowProtectSvc.exe NT service account):

    net use \\officepc\shareddocs JoesPassword /USER:JoesDomain\JoesUserName

     

    put that statement (above) at the start of your script.

     

Page 1 of 1 (2 items)
(c) StorageCraft Technology Corporation 2008