+ Post New Thread
Results 1 to 5 of 5
How do you do....it? Thread, Run a backup then shutdown? in Technical; I have a machine that continually shows an error after attempting a backup. If I manually run MSbackup as Administrator ...
  1. #1
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41

    Run a backup then shutdown?

    I have a machine that continually shows an error after attempting a backup. If I manually run MSbackup as Administrator it runs fine. I'm thinking it must be a permissions thing somewhere. It is becoming a pain to have to remote into it to do the backup manually. (remotely late at night) What I would like to do is to run the backup (possibly as administrator) and have the machine shutdown after it has completed. Is this possible?

    The machine is running XP SP3 and is backing-up to a 2008 server share. Incidentally it worked fine when we had a 2003 server
    Last edited by leco; 10th June 2009 at 04:26 PM.

  2. #2
    maf_001's Avatar
    Join Date
    Feb 2008
    Posts
    51
    Thank Post
    2
    Thanked 12 Times in 10 Posts
    Rep Power
    16

    VBS script

    I have a few problems when i worked in schools with programs not running when logged in a standard user, try using this vbs script to run your program as administrator it can be run from schedual tasks or somthing like that.

    'Start of Script
    Option explicit

    Dim oShell

    WScript.Sleep 1000

    set oShell= Wscript.CreateObject("WScript.Shell")

    oShell.Run "runas /noprofile /user:domainname\administrator ""cscript.exe c:\yourcommand.bat"

    WScript.Sleep 200

    oShell.Sendkeys "myfunkypassword~"

    WScript.Sleep 1000

    oShell.Run "runas /noprofile /user:domainname\administrator ""c:\yourcommand.bat"

    WScript.Sleep 200

    oShell.Sendkeys "myfunkypassword~"

    Wscript.Quit


    Make sure you put the ~ after your password otheriwse it will not work.

  3. #3
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41
    Need some help here - I'll be honest and say I know nothing about running scripts. What exactly do I do with it and where do I put it please?

  4. #4
    maf_001's Avatar
    Join Date
    Feb 2008
    Posts
    51
    Thank Post
    2
    Thanked 12 Times in 10 Posts
    Rep Power
    16

    Running the script

    Ok i have attached notes to this script please remove my notes when trying to run the script yourself.


    '--------------------------------------------------------------------------------------------------
    'Start of Script
    Option explicit

    Dim oShell

    WScript.Sleep 1000

    set oShell= Wscript.CreateObject("WScript.Shell")+

    ''' The line below will run you command as the user specified as you can see i have set it to run notepad.
    oShell.Run "runas /noprofile /user:MYDOMAIN\administrator ""c:\Windows\notepad.exe"

    '''This line just sleeps the command for a short while for the pc to process the last command
    WScript.Sleep 200

    '''This sends the administrator password to run the program
    oShell.Sendkeys "myfunkypassword~"

    WScript.Sleep 1000

    oShell.Run "runas /noprofile /user:domainname\administrator ""c:\yourcommand.bat"

    WScript.Sleep 200

    oShell.Sendkeys "happy~"

    Wscript.Quit
    '--------------------------------------------------------------------------------------------------

    This script is setup to run two commands, you will need to make changes to the command you want to run, the domain name and the password.
    You will need to copy and paste the code into notepad and save the file as a .vbs. you can then use the .vbs file to be run on the client workstation.

  5. Thanks to maf_001 from:

    leco (14th June 2009)

  6. #5
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41
    Thanks for the detailed info - will have a go at it on a spare machine before running in production.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 16th December 2008, 10:18 AM
  2. Backup Exec 11D fails to backup DC
    By cookie_monster in forum Windows
    Replies: 13
    Last Post: 23rd June 2008, 11:34 AM
  3. Backup Tapes Replacement & Backup Schedules
    By robknowles in forum Hardware
    Replies: 2
    Last Post: 18th April 2007, 10:55 PM
  4. how to run a registry patch on shutdown/logoff
    By The_Traveller in forum Windows
    Replies: 13
    Last Post: 20th November 2006, 08:52 AM
  5. Replies: 9
    Last Post: 1st August 2006, 10:25 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •