Guest Juan García Posted June 1, 2008 Posted June 1, 2008 I have a vbscript file (backup.vbs) that does some calculations and then call the ntbackup program with parameters. If I execute in the Start / Execute box the command "cscript backup.vbs" (or if I doubleclic the .vbs in the windows explorer) I can see the interface of the ntbackup program, the progress of the backup and when it ends the windows close. I would like to execute the script from the task scheduler. I add a new task and I write in the execute box "cscript backup.vbs" and I can see two important differences: 1.- The backup is completed and the bkf file created, but it happens in background. How can I see the ntbackup interface? I need the progress of the backup. 2.- More important. The backup process doesn´t log any file. It seems the task doesn't work but the problem is than doesn't create the log file. I want the scheduler runs like the first method and I don't want call any batch file, I need call the vbs. Thanks a lot
Guest Pegasus \(MVP\) Posted June 1, 2008 Posted June 1, 2008 Re: Cscript from task scheduler "Juan García" <nl144049XXX@gmXXXail.com> wrote in message news:uPRpD3CxIHA.5892@TK2MSFTNGP02.phx.gbl... >I have a vbscript file (backup.vbs) that does some calculations and then >call the ntbackup program with parameters. If I execute in the Start / >Execute box the command "cscript backup.vbs" (or if I doubleclic the .vbs >in the windows explorer) I can see the interface of the ntbackup program, >the progress of the backup and when it ends the windows close. > I would like to execute the script from the task scheduler. I add a new > task and I write in the execute box "cscript backup.vbs" and I can see two > important differences: > 1.- The backup is completed and the bkf file created, but it happens in > background. How can I see the ntbackup interface? I need the progress of > the backup. > 2.- More important. The backup process doesn´t log any file. It seems the > task doesn't work but the problem is than doesn't create the log file. > I want the scheduler runs like the first method and I don't want call any > batch file, I need call the vbs. > Thanks a lot > Let's have a look at your VB Script file. What makes you think there is no log file? Did you scan your disk for backup*.log files?
Guest Juan García Posted June 2, 2008 Posted June 2, 2008 Re: Cscript from task scheduler 1.- This is the script dim WshShell Dim cadena Set WshShell = WScript.CreateObject("WScript.Shell") cadena = "%windir%\system32\ntbackup.exe backup ""@c:\a\copia.bks"" /n ""Total.bkf creado 19/01/2008 a las 11:47"" /d ""Conjunto creado el 19/01/2008 a las 11:47"" /n ""Total.bkf creado 19/01/2008 a las 11:47"" /v:no /r:no /rs:no /hc:off /m normal /j ""Total "" /l:f /f ""c:\a\copia.bkf""" WshShell.Run cadena, 1, true set WshShell = Nothing 2.- I look for the log where the ntbackup program writes the log files: C:\Documents and Settings\<user>\Configuración local\Datos de programa\Microsoft\Windows NT\NTBackup\data Am I right??? Thanks... "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje news:eVlbeUDxIHA.3968@TK2MSFTNGP04.phx.gbl... > > "Juan García" <nl144049XXX@gmXXXail.com> wrote in message > news:uPRpD3CxIHA.5892@TK2MSFTNGP02.phx.gbl... >>I have a vbscript file (backup.vbs) that does some calculations and then >>call the ntbackup program with parameters. If I execute in the Start / >>Execute box the command "cscript backup.vbs" (or if I doubleclic the .vbs >>in the windows explorer) I can see the interface of the ntbackup program, >>the progress of the backup and when it ends the windows close. >> I would like to execute the script from the task scheduler. I add a new >> task and I write in the execute box "cscript backup.vbs" and I can see >> two important differences: >> 1.- The backup is completed and the bkf file created, but it happens in >> background. How can I see the ntbackup interface? I need the progress of >> the backup. >> 2.- More important. The backup process doesn´t log any file. It seems the >> task doesn't work but the problem is than doesn't create the log file. >> I want the scheduler runs like the first method and I don't want call any >> batch file, I need call the vbs. >> Thanks a lot >> > > Let's have a look at your VB Script file. > What makes you think there is no log file? Did you scan your > disk for backup*.log files? >
Guest Pegasus \(MVP\) Posted June 2, 2008 Posted June 2, 2008 Re: Cscript from task scheduler I ran the following script, which is almost identical to your own script: dim WshShell Dim cadena Set WshShell = WScript.CreateObject("WScript.Shell") cadena = "%windir%\system32\ntbackup.exe backup ""@c:\test.bks""" _ & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ & " /d ""Conjunto creado el 19/01/2008 a las 11:47""" _ & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ & " /v:no /r:no /rs:no /hc:off /m normal /j ""Total """ _ & " /l:f /f ""c:\copia.bkf""" WshShell.Run cadena, 1, True Set WshShell = Nothing It ran perfectly, both in the foreground and as a scheduled task. If it does not run in your case then you may have a problem with account permissions. Try to simplify the job by running the following batch file instead: @echo off echo %date% %time% %UserName% >> c:\test.log cscript //nologo c:\backup.vbs 1>> c:\test.log 2>>&1 echo %date% %time% end of job >> c:\test.log When checking the log file, make sure to look for it in the correct profile folder. "Juan García" <nl144049XXX@gmXXXail.com> wrote in message news:%23AOeVJOxIHA.2360@TK2MSFTNGP05.phx.gbl... > 1.- This is the script > > dim WshShell > Dim cadena > Set WshShell = WScript.CreateObject("WScript.Shell") > cadena = "%windir%\system32\ntbackup.exe backup ""@c:\a\copia.bks"" /n > ""Total.bkf creado 19/01/2008 a las 11:47"" /d ""Conjunto creado el > 19/01/2008 a las 11:47"" /n ""Total.bkf creado 19/01/2008 a las 11:47"" > /v:no /r:no /rs:no /hc:off /m normal /j ""Total "" /l:f /f > ""c:\a\copia.bkf""" > WshShell.Run cadena, 1, true > set WshShell = Nothing > > 2.- I look for the log where the ntbackup program writes the log files: > C:\Documents and Settings\<user>\Configuración local\Datos de > programa\Microsoft\Windows NT\NTBackup\data > > Am I right??? Thanks... > > > "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje > news:eVlbeUDxIHA.3968@TK2MSFTNGP04.phx.gbl... >> >> "Juan García" <nl144049XXX@gmXXXail.com> wrote in message >> news:uPRpD3CxIHA.5892@TK2MSFTNGP02.phx.gbl... >>>I have a vbscript file (backup.vbs) that does some calculations and then >>>call the ntbackup program with parameters. If I execute in the Start / >>>Execute box the command "cscript backup.vbs" (or if I doubleclic the .vbs >>>in the windows explorer) I can see the interface of the ntbackup program, >>>the progress of the backup and when it ends the windows close. >>> I would like to execute the script from the task scheduler. I add a new >>> task and I write in the execute box "cscript backup.vbs" and I can see >>> two important differences: >>> 1.- The backup is completed and the bkf file created, but it happens in >>> background. How can I see the ntbackup interface? I need the progress of >>> the backup. >>> 2.- More important. The backup process doesn´t log any file. It seems >>> the task doesn't work but the problem is than doesn't create the log >>> file. >>> I want the scheduler runs like the first method and I don't want call >>> any batch file, I need call the vbs. >>> Thanks a lot >>> >> >> Let's have a look at your VB Script file. >> What makes you think there is no log file? Did you scan your >> disk for backup*.log files? >> > >
Guest Juan García Posted June 2, 2008 Posted June 2, 2008 Re: Cscript from task scheduler Hi, Pegasus... I can't understand it. I don't want use batch files because certain complex calculations... I'll try in the server, I was triynig it in a win xp client.... i don't know... thanks.. "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje news:%23NuWbgOxIHA.3860@TK2MSFTNGP06.phx.gbl... >I ran the following script, which is almost identical to your > own script: > dim WshShell > Dim cadena > Set WshShell = WScript.CreateObject("WScript.Shell") > cadena = "%windir%\system32\ntbackup.exe backup ""@c:\test.bks""" _ > & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ > & " /d ""Conjunto creado el 19/01/2008 a las 11:47""" _ > & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ > & " /v:no /r:no /rs:no /hc:off /m normal /j ""Total """ _ > & " /l:f /f ""c:\copia.bkf""" > WshShell.Run cadena, 1, True > Set WshShell = Nothing > > It ran perfectly, both in the foreground and as a scheduled task. > If it does not run in your case then you may have a problem > with account permissions. Try to simplify the job by running > the following batch file instead: > @echo off > echo %date% %time% %UserName% >> c:\test.log > cscript //nologo c:\backup.vbs 1>> c:\test.log 2>>&1 > echo %date% %time% end of job >> c:\test.log > > When checking the log file, make sure to look for it in > the correct profile folder. > > > "Juan García" <nl144049XXX@gmXXXail.com> wrote in message > news:%23AOeVJOxIHA.2360@TK2MSFTNGP05.phx.gbl... >> 1.- This is the script >> >> dim WshShell >> Dim cadena >> Set WshShell = WScript.CreateObject("WScript.Shell") >> cadena = "%windir%\system32\ntbackup.exe backup ""@c:\a\copia.bks"" /n >> ""Total.bkf creado 19/01/2008 a las 11:47"" /d ""Conjunto creado el >> 19/01/2008 a las 11:47"" /n ""Total.bkf creado 19/01/2008 a las 11:47"" >> /v:no /r:no /rs:no /hc:off /m normal /j ""Total "" /l:f /f >> ""c:\a\copia.bkf""" >> WshShell.Run cadena, 1, true >> set WshShell = Nothing >> >> 2.- I look for the log where the ntbackup program writes the log files: >> C:\Documents and Settings\<user>\Configuración local\Datos de >> programa\Microsoft\Windows NT\NTBackup\data >> >> Am I right??? Thanks... >> >> >> "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje >> news:eVlbeUDxIHA.3968@TK2MSFTNGP04.phx.gbl... >>> >>> "Juan García" <nl144049XXX@gmXXXail.com> wrote in message >>> news:uPRpD3CxIHA.5892@TK2MSFTNGP02.phx.gbl... >>>>I have a vbscript file (backup.vbs) that does some calculations and then >>>>call the ntbackup program with parameters. If I execute in the Start / >>>>Execute box the command "cscript backup.vbs" (or if I doubleclic the >>>>.vbs in the windows explorer) I can see the interface of the ntbackup >>>>program, the progress of the backup and when it ends the windows close. >>>> I would like to execute the script from the task scheduler. I add a new >>>> task and I write in the execute box "cscript backup.vbs" and I can see >>>> two important differences: >>>> 1.- The backup is completed and the bkf file created, but it happens in >>>> background. How can I see the ntbackup interface? I need the progress >>>> of the backup. >>>> 2.- More important. The backup process doesn´t log any file. It seems >>>> the task doesn't work but the problem is than doesn't create the log >>>> file. >>>> I want the scheduler runs like the first method and I don't want call >>>> any batch file, I need call the vbs. >>>> Thanks a lot >>>> >>> >>> Let's have a look at your VB Script file. >>> What makes you think there is no log file? Did you scan your >>> disk for backup*.log files? >>> >> >> > >
Guest Pegasus \(MVP\) Posted June 2, 2008 Posted June 2, 2008 Re: Cscript from task scheduler The batch file I recommended is purely for debugging. After you have identified your problem, you no longer need the batch file. "Juan García" <nl144049XXX@gmXXXail.com> wrote in message news:%23jQSN8OxIHA.5996@TK2MSFTNGP04.phx.gbl... > Hi, Pegasus... I can't understand it. I don't want use batch files because > certain complex calculations... > I'll try in the server, I was triynig it in a win xp client.... i don't > know... thanks.. > > "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje > news:%23NuWbgOxIHA.3860@TK2MSFTNGP06.phx.gbl... >>I ran the following script, which is almost identical to your >> own script: >> dim WshShell >> Dim cadena >> Set WshShell = WScript.CreateObject("WScript.Shell") >> cadena = "%windir%\system32\ntbackup.exe backup ""@c:\test.bks""" _ >> & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ >> & " /d ""Conjunto creado el 19/01/2008 a las 11:47""" _ >> & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ >> & " /v:no /r:no /rs:no /hc:off /m normal /j ""Total """ _ >> & " /l:f /f ""c:\copia.bkf""" >> WshShell.Run cadena, 1, True >> Set WshShell = Nothing >> >> It ran perfectly, both in the foreground and as a scheduled task. >> If it does not run in your case then you may have a problem >> with account permissions. Try to simplify the job by running >> the following batch file instead: >> @echo off >> echo %date% %time% %UserName% >> c:\test.log >> cscript //nologo c:\backup.vbs 1>> c:\test.log 2>>&1 >> echo %date% %time% end of job >> c:\test.log >> >> When checking the log file, make sure to look for it in >> the correct profile folder. >> >> >> "Juan García" <nl144049XXX@gmXXXail.com> wrote in message >> news:%23AOeVJOxIHA.2360@TK2MSFTNGP05.phx.gbl... >>> 1.- This is the script >>> >>> dim WshShell >>> Dim cadena >>> Set WshShell = WScript.CreateObject("WScript.Shell") >>> cadena = "%windir%\system32\ntbackup.exe backup ""@c:\a\copia.bks"" /n >>> ""Total.bkf creado 19/01/2008 a las 11:47"" /d ""Conjunto creado el >>> 19/01/2008 a las 11:47"" /n ""Total.bkf creado 19/01/2008 a las 11:47"" >>> /v:no /r:no /rs:no /hc:off /m normal /j ""Total "" /l:f /f >>> ""c:\a\copia.bkf""" >>> WshShell.Run cadena, 1, true >>> set WshShell = Nothing >>> >>> 2.- I look for the log where the ntbackup program writes the log files: >>> C:\Documents and Settings\<user>\Configuración local\Datos de >>> programa\Microsoft\Windows NT\NTBackup\data >>> >>> Am I right??? Thanks... >>> >>> >>> "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje >>> news:eVlbeUDxIHA.3968@TK2MSFTNGP04.phx.gbl... >>>> >>>> "Juan García" <nl144049XXX@gmXXXail.com> wrote in message >>>> news:uPRpD3CxIHA.5892@TK2MSFTNGP02.phx.gbl... >>>>>I have a vbscript file (backup.vbs) that does some calculations and >>>>>then call the ntbackup program with parameters. If I execute in the >>>>>Start / Execute box the command "cscript backup.vbs" (or if I >>>>>doubleclic the .vbs in the windows explorer) I can see the interface of >>>>>the ntbackup program, the progress of the backup and when it ends the >>>>>windows close. >>>>> I would like to execute the script from the task scheduler. I add a >>>>> new task and I write in the execute box "cscript backup.vbs" and I can >>>>> see two important differences: >>>>> 1.- The backup is completed and the bkf file created, but it happens >>>>> in background. How can I see the ntbackup interface? I need the >>>>> progress of the backup. >>>>> 2.- More important. The backup process doesn´t log any file. It seems >>>>> the task doesn't work but the problem is than doesn't create the log >>>>> file. >>>>> I want the scheduler runs like the first method and I don't want call >>>>> any batch file, I need call the vbs. >>>>> Thanks a lot >>>>> >>>> >>>> Let's have a look at your VB Script file. >>>> What makes you think there is no log file? Did you scan your >>>> disk for backup*.log files? >>>> >>> >>> >> >> > >
Guest Juan García Posted June 2, 2008 Posted June 2, 2008 Re: Cscript from task scheduler > When checking the log file, make sure to look for it in > the correct profile folder. Yesssss..... pfuffffff... I was using another user for the task scheduler... Thanks a lot... "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje news:%23NuWbgOxIHA.3860@TK2MSFTNGP06.phx.gbl... >I ran the following script, which is almost identical to your > own script: > dim WshShell > Dim cadena > Set WshShell = WScript.CreateObject("WScript.Shell") > cadena = "%windir%\system32\ntbackup.exe backup ""@c:\test.bks""" _ > & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ > & " /d ""Conjunto creado el 19/01/2008 a las 11:47""" _ > & " /n ""Total.bkf creado 19/01/2008 a las 11:47""" _ > & " /v:no /r:no /rs:no /hc:off /m normal /j ""Total """ _ > & " /l:f /f ""c:\copia.bkf""" > WshShell.Run cadena, 1, True > Set WshShell = Nothing > > It ran perfectly, both in the foreground and as a scheduled task. > If it does not run in your case then you may have a problem > with account permissions. Try to simplify the job by running > the following batch file instead: > @echo off > echo %date% %time% %UserName% >> c:\test.log > cscript //nologo c:\backup.vbs 1>> c:\test.log 2>>&1 > echo %date% %time% end of job >> c:\test.log > > When checking the log file, make sure to look for it in > the correct profile folder. > > > "Juan García" <nl144049XXX@gmXXXail.com> wrote in message > news:%23AOeVJOxIHA.2360@TK2MSFTNGP05.phx.gbl... >> 1.- This is the script >> >> dim WshShell >> Dim cadena >> Set WshShell = WScript.CreateObject("WScript.Shell") >> cadena = "%windir%\system32\ntbackup.exe backup ""@c:\a\copia.bks"" /n >> ""Total.bkf creado 19/01/2008 a las 11:47"" /d ""Conjunto creado el >> 19/01/2008 a las 11:47"" /n ""Total.bkf creado 19/01/2008 a las 11:47"" >> /v:no /r:no /rs:no /hc:off /m normal /j ""Total "" /l:f /f >> ""c:\a\copia.bkf""" >> WshShell.Run cadena, 1, true >> set WshShell = Nothing >> >> 2.- I look for the log where the ntbackup program writes the log files: >> C:\Documents and Settings\<user>\Configuración local\Datos de >> programa\Microsoft\Windows NT\NTBackup\data >> >> Am I right??? Thanks... >> >> >> "Pegasus (MVP)" <I.can@fly.com.oz> escribió en el mensaje >> news:eVlbeUDxIHA.3968@TK2MSFTNGP04.phx.gbl... >>> >>> "Juan García" <nl144049XXX@gmXXXail.com> wrote in message >>> news:uPRpD3CxIHA.5892@TK2MSFTNGP02.phx.gbl... >>>>I have a vbscript file (backup.vbs) that does some calculations and then >>>>call the ntbackup program with parameters. If I execute in the Start / >>>>Execute box the command "cscript backup.vbs" (or if I doubleclic the >>>>.vbs in the windows explorer) I can see the interface of the ntbackup >>>>program, the progress of the backup and when it ends the windows close. >>>> I would like to execute the script from the task scheduler. I add a new >>>> task and I write in the execute box "cscript backup.vbs" and I can see >>>> two important differences: >>>> 1.- The backup is completed and the bkf file created, but it happens in >>>> background. How can I see the ntbackup interface? I need the progress >>>> of the backup. >>>> 2.- More important. The backup process doesn´t log any file. It seems >>>> the task doesn't work but the problem is than doesn't create the log >>>> file. >>>> I want the scheduler runs like the first method and I don't want call >>>> any batch file, I need call the vbs. >>>> Thanks a lot >>>> >>> >>> Let's have a look at your VB Script file. >>> What makes you think there is no log file? Did you scan your >>> disk for backup*.log files? >>> >> >> > >
Recommended Posts