|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#26 |
|
Messages: n/a
Hébergeur: |
Dear all,
Am sorry that the thread went to some heated exchanges... Guys.. pls don take anything personal.. just exchange knowledge.. no exchange of feelings..... And if I only felt it.. am sorry about that too... Thanks, Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%230ig292LIHA.5468@TK2MSFTNGP05.phx.gbl... Now why is that I feel like a dentist trying to extract a wisdom tooth? Here is a nice and simple solution: @echo off :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 echo. set /r reply=The network is not available. Try again? (Y/N) if /i "%reply%"=="Y" (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder 192.168.0.1 is the IP address of your server. Now if you prefer a dialog box instead of a Command Prompt to warn the user then you can do it by invoking a small .vbs script: @echo off echo wscript.quit(MsgBox("The network is not available. Try again?", 1, "Network Problem")) > c:\box.vbs :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 cscript.exe //nologo c:\box.vbs if %ErrorLevel%==1 (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder I haven not had the time to fully test this script. If you want the whole lot in a .vbs script file then you need a lot more than just six lines of code. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:O51DJL2LIHA.4684@TK2MSFTNGP06.phx.gbl... Sorry for the confusion... let me xplain once more... The script will be scheduled to run on a weekly basis at 8.00 AM on all the workstations. The msg is supposed to pop up, whenevr the network is not available. The user has to respond to the msgbox, to either Abort the operation, retry the operation or cancel it. Here the user will respond to it... The thought process is that.. if the user has not connected the network cable, and the msg pops up, then he can check his network conection and then retry it... Thanks .... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:eQahME2LIHA.4196@TK2MSFTNGP04.phx.gbl... When you require a script then it s to provide plenty of background information. It is now clear why you might get this dialog box. Now please try to answer my remaining questions - this is ESSENTIAL! - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:Of7t6s1LIHA.4272@TK2MSFTNGP05.phx.gbl... leme explain... In case the network conectivity is not available, and the scheduled backup fires up.... then it should give a msg in a msgbox telling that "Network connectivity unavailable, Try again?" with the buttons Abort, retry and cancel. Hope i have made it clear.. My intention in doing this is to make backup of the pst files of MS outlook of all workstations (in our case all are laptops).... Thanks once again... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:uJjN%23J0LIHA.5224@TK2MSFTNGP02.phx.gbl... Your request is unclear. - What generates the "Abort, retry, Cancel" dialog box? - Why? - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:%23GsGbE0LIHA.2432@TK2MSFTNGP04.phx.gbl... thanks very much pegasus.. I wanted the vbscript for the "Abort, retry, Cancel" command box and to check for the network connectivity before the xcopy is fired... Could anyone please guide me to a good scripting resource. I hav experience working in vb. Thanks Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%236SY2YzLIHA.4228@TK2MSFTNGP02.phx.gbl... A batch file would be considerably simpler: @echo off xcopy /s /d /y /c "d:\My Files" \\My Server\Some Share\Some Folder Make sure to schedule the command under an account that has sufficient privileges to access the the source & target areas. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:OwKD6WyLIHA.4752@TK2MSFTNGP05.phx.gbl... Dear all, I wanted the vbscript for script for scheduled backing up local content files to the network file storage on a weekly basis. Could anyone please .... Thanks.. Stan |
|
|
|
#27 |
|
Messages: n/a
Hébergeur: |
Dear Pegasus,
Thanks for the reply.. I am having a questio... at the line of Ping I get the following error: " 'ping' is not recognized as an internal or external command, operable program or batch file." Could you please .. I tried using it in a batch file and also as a vbs file. Thanks, Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%230ig292LIHA.5468@TK2MSFTNGP05.phx.gbl... Now why is that I feel like a dentist trying to extract a wisdom tooth? Here is a nice and simple solution: @echo off :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 echo. set /r reply=The network is not available. Try again? (Y/N) if /i "%reply%"=="Y" (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder 192.168.0.1 is the IP address of your server. Now if you prefer a dialog box instead of a Command Prompt to warn the user then you can do it by invoking a small .vbs script: @echo off echo wscript.quit(MsgBox("The network is not available. Try again?", 1, "Network Problem")) > c:\box.vbs :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 cscript.exe //nologo c:\box.vbs if %ErrorLevel%==1 (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder I haven not had the time to fully test this script. If you want the whole lot in a .vbs script file then you need a lot more than just six lines of code. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:O51DJL2LIHA.4684@TK2MSFTNGP06.phx.gbl... Sorry for the confusion... let me xplain once more... The script will be scheduled to run on a weekly basis at 8.00 AM on all the workstations. The msg is supposed to pop up, whenevr the network is not available. The user has to respond to the msgbox, to either Abort the operation, retry the operation or cancel it. Here the user will respond to it... The thought process is that.. if the user has not connected the network cable, and the msg pops up, then he can check his network conection and then retry it... Thanks .... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:eQahME2LIHA.4196@TK2MSFTNGP04.phx.gbl... When you require a script then it s to provide plenty of background information. It is now clear why you might get this dialog box. Now please try to answer my remaining questions - this is ESSENTIAL! - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:Of7t6s1LIHA.4272@TK2MSFTNGP05.phx.gbl... leme explain... In case the network conectivity is not available, and the scheduled backup fires up.... then it should give a msg in a msgbox telling that "Network connectivity unavailable, Try again?" with the buttons Abort, retry and cancel. Hope i have made it clear.. My intention in doing this is to make backup of the pst files of MS outlook of all workstations (in our case all are laptops).... Thanks once again... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:uJjN%23J0LIHA.5224@TK2MSFTNGP02.phx.gbl... Your request is unclear. - What generates the "Abort, retry, Cancel" dialog box? - Why? - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:%23GsGbE0LIHA.2432@TK2MSFTNGP04.phx.gbl... thanks very much pegasus.. I wanted the vbscript for the "Abort, retry, Cancel" command box and to check for the network connectivity before the xcopy is fired... Could anyone please guide me to a good scripting resource. I hav experience working in vb. Thanks Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%236SY2YzLIHA.4228@TK2MSFTNGP02.phx.gbl... A batch file would be considerably simpler: @echo off xcopy /s /d /y /c "d:\My Files" \\My Server\Some Share\Some Folder Make sure to schedule the command under an account that has sufficient privileges to access the the source & target areas. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:OwKD6WyLIHA.4752@TK2MSFTNGP05.phx.gbl... Dear all, I wanted the vbscript for script for scheduled backing up local content files to the network file storage on a weekly basis. Could anyone please .... Thanks.. Stan |
|
|
|
#28 |
|
Messages: n/a
Hébergeur: |
- Have a look where ping.exe resides. It should be in the System32 directory.
- Check your %path%. It must include the c:\Windows\System32 directory. - Execute ping.exe directly from the Command Prompt. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:u93LgLPMIHA.4456@TK2MSFTNGP03.phx.gbl... Dear Pegasus, Thanks for the reply.. I am having a questio... at the line of Ping I get the following error: " 'ping' is not recognized as an internal or external command, operable program or batch file." Could you please .. I tried using it in a batch file and also as a vbs file. Thanks, Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%230ig292LIHA.5468@TK2MSFTNGP05.phx.gbl... Now why is that I feel like a dentist trying to extract a wisdom tooth? Here is a nice and simple solution: @echo off :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 echo. set /r reply=The network is not available. Try again? (Y/N) if /i "%reply%"=="Y" (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder 192.168.0.1 is the IP address of your server. Now if you prefer a dialog box instead of a Command Prompt to warn the user then you can do it by invoking a small .vbs script: @echo off echo wscript.quit(MsgBox("The network is not available. Try again?", 1, "Network Problem")) > c:\box.vbs :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 cscript.exe //nologo c:\box.vbs if %ErrorLevel%==1 (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder I haven not had the time to fully test this script. If you want the whole lot in a .vbs script file then you need a lot more than just six lines of code. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:O51DJL2LIHA.4684@TK2MSFTNGP06.phx.gbl... Sorry for the confusion... let me xplain once more... The script will be scheduled to run on a weekly basis at 8.00 AM on all the workstations. The msg is supposed to pop up, whenevr the network is not available. The user has to respond to the msgbox, to either Abort the operation, retry the operation or cancel it. Here the user will respond to it... The thought process is that.. if the user has not connected the network cable, and the msg pops up, then he can check his network conection and then retry it... Thanks .... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:eQahME2LIHA.4196@TK2MSFTNGP04.phx.gbl... When you require a script then it s to provide plenty of background information. It is now clear why you might get this dialog box. Now please try to answer my remaining questions - this is ESSENTIAL! - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:Of7t6s1LIHA.4272@TK2MSFTNGP05.phx.gbl... leme explain... In case the network conectivity is not available, and the scheduled backup fires up.... then it should give a msg in a msgbox telling that "Network connectivity unavailable, Try again?" with the buttons Abort, retry and cancel. Hope i have made it clear.. My intention in doing this is to make backup of the pst files of MS outlook of all workstations (in our case all are laptops).... Thanks once again... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:uJjN%23J0LIHA.5224@TK2MSFTNGP02.phx.gbl... Your request is unclear. - What generates the "Abort, retry, Cancel" dialog box? - Why? - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:%23GsGbE0LIHA.2432@TK2MSFTNGP04.phx.gbl... thanks very much pegasus.. I wanted the vbscript for the "Abort, retry, Cancel" command box and to check for the network connectivity before the xcopy is fired... Could anyone please guide me to a good scripting resource. I hav experience working in vb. Thanks Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%236SY2YzLIHA.4228@TK2MSFTNGP02.phx.gbl... A batch file would be considerably simpler: @echo off xcopy /s /d /y /c "d:\My Files" \\My Server\Some Share\Some Folder Make sure to schedule the command under an account that has sufficient privileges to access the the source & target areas. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:OwKD6WyLIHA.4752@TK2MSFTNGP05.phx.gbl... Dear all, I wanted the vbscript for script for scheduled backing up local content files to the network file storage on a weekly basis. Could anyone please .... Thanks.. Stan |
|
|
|
#29 |
|
Messages: n/a
Hébergeur: |
Hi Stanley,
I need to say that I'm fairly busy these days so I might not be able to much (if at all) in customising it to suit your needs. The other issue with scheduled batch files is that I think they generate "cmd" boxes that can't be hidden from logged on users - unless I guess you run the script under a different username that the user never sees, but if you do that, then I'm not sure how the script can interact with a logged on user - all questions that go beyond my experience/skill. Anyway, if you want to have a go with tweaking this script - feel welcome... @echo off setlocal enabledelayedexpansion REM ************************************************** ************************************************** ****************** REM * Title: BACKUP-DRIVE.BAT REM * Author: DR. REM * Purpose: To backup any portable drive, typically a USB memory stick, to a drive/folder on the local system. REM * Environment: Tested, and working on WinXP SP2 and Win2000 SP4 from local Admin accounts. REM * REM * Vers Date Who Description REM * ---- ---- --- ----------- REM * v0.01 13-FEB-2006 DR Original draft. REM * v0.02 13-FEB-2006 DR Save to date stamped backup file. REM * v0.03 14-FEB-2006 DR Set a default backup path, but can choose other areas for other computers. REM * v0.04 14-FEB-2006 DR No longer use date stamps, but rotate files through previous and current. REM * v0.05 14-FEB-2006 DR Ensure that we don't try to backup ourself, e.g. can't backup C: to C:. REM * v0.06 14-FEB-2006 DR Default target drive to be the same as the system drive (might not be C .REM * v0.07 14-FEB-2006 DR Prefix all messages with "FAC", i.e. the facility/tool name. REM * v0.08 14-FEB-2006 DR Add comments re "ntbackup" parameters and switches. REM * v0.09 28-MAR-2007 DR Save to no-backup for machine xxxxxx. REM * v0.10 18-APR-2007 DR Improved variable names/quotes, show time stamps on messages, tidy messages. REM * v0.11 18-APR-2007 DR Added log checking routine. REM * v0.12 18-APR-2007 DR Added code to append to a CSV spreadsheet with stats. REM * v0.13 18-APR-2007 DR Added disclaimer. REM * v0.14 18-APR-2007 DR Added some REM notes about NTBackup behaviour. REM * v0.15 19-APR-2007 DR Fix making hhmmss time, and check media name i.e. backup file/save set name. REM * v0.16 19-APR-2007 DR Use a lock flag file to catch/stop multiple backup jobs from running. REM * v0.17 19-APR-2007 DR Windows 2000 (NTBackup v5.0) doesn't write media set name in backup section of log. REM * v0.18 24-NOV-2007 DR Write to a date stamped log file, calculate MB/s, clearer variable names. REM * v0.19 25-NOV-2007 DR Store log files with the backups in a \logs sub-folder. REM ************************************************** ************************************************** ****************** REM * DISCLAIMER: REM * REM * All are free to copy, use, and modify this script in commercial and for-profit environments, also free to REM * use and modify for personal, home, and home office use - BUT only if the version table header above, and REM * this disclaimer remain intact. This script may not be published in any medium without prior signed written REM * permission of the author. No warranty, assurances, guarantees, claims to reliability or support are offered. REM * Users of this script accept all responsibility and/or liability for any risk of, and/or actual, injury, harm, REM * commercial or personal loss. REM * REM * WARNING: This script makes no claim to the restorability or recoverability of data and program code, using either REM * Microsoft NTBackup and/or any other data backup tool. REM * REM * SEVERE WARNING: This script should not be relied upon in situations where critical, commercially confident, REM * and/or sensitive data need to be saved/backed-up and possibly restored and/or recovered. REM * REM * EXTREME WARNING: It has traditionally been the case that all verisons of Microsoft NTBackup are unable to read REM * backups taken with any previous versions of NTBackup. This script should not be used for medium to long term REM * data retention, nor as a tool for use between operating system upgrades. REM * REM ************************************************** ************************************************** ****************** REM * USAGE: REM * REM * a) Just copy/drop this batch file anywhere on your memory stick, typically the root, and double click to run it. REM * b) It keeps two copies of backups. The most recent called "curr" (or current) and the previous called "prev". REM * c) Backup files are rotated out, so when running for a third time, the oldest backup (i.e. "prev") will be REM * deleted, and "curr" renamed to "prev", and then a new "curr" will be written. REM * d) It will always keep a "prev" backup, i.e. the "prev" will only be deleted if a "curr" exists. REM * e) It defaults to saving the backup file, on the system drive, in folder "\backup". You can change this by REM * adding other computernames. See the examples below. REM * f) Two or more backups should not be run together, as the log checking routine enbedded within this script REM * will not know which log file to check. REM * REM ************************************************** ************************************************** ****************** REM * CHANGES TO MAKE: REM * REM * 1) Don't backup the whole drive that the script lives in, but instead backup the folder structure that the REM * script lives in, i.e. can then be used to backup just a certain folder on the memory stick. The "bkf" file REM * name may need to include the folder name. Need to work out how to convert colons and slash to hyphen or REM * underscore. REM * REM ************************************************** ************************************************** ****************** set z_debug=NO set z_script_spec=%~dpnx0 set z_script_path=%~dp0 set z_script_name=%~n0 color 2e title !z_script_name! set z_run_date=!date! set z_run_time=!time! if "!z_run_date:~2,1!"=="/" ( set z_run_yyyymmdd=!z_run_date:~6,4!!z_run_date:~3,2!! z_run_date:~0,2! ) else ( set z_run_yyyymmdd=!z_run_date:~10,4!!z_run_date:~7,2! !z_run_date:~4,2! ) set z_run_hhmmss=!z_run_time:~0,2!!z_run_time:~3,2!!z_ run_time:~6,2! set z_sys_drive=!windir:~0,1! set z_csv_spec=!z_script_path!!z_script_name!.csv REM ************************************************** ************************************************** ****************** REM * Add your own machine/computer name here, if you want your backups to be saved to an area other than the REM * default of %SYSTEMDRIVE%:\backup... REM * set z_bkf_path=!z_sys_drive!:\backup if /i "!computername!"=="xxxxxx" set z_bkf_path=D:\backup if /i "!computername!"=="yyyyyy" set z_bkf_path=C:\no-backup REM ************************************************** ************************************************** ****************** set z_log_path=!z_bkf_path!\logs\ set z_log_spec=!z_log_path!!z_run_yyyymmdd!-!z_run_hhmmss!.log if not exist "!z_log_path!" (mkdir "!z_log_path!") call :log "************************************************* *****" call :log "Script: !z_script_spec!" call :log "Computer: !computername!" call :log "Run date: !z_run_date! !z_run_time:~0,8!" call :log "Log spec: !z_log_spec!" set z_lck_spec=!z_bkf_path!\!z_script_name!.lck if exist "!z_lck_spec!" ( call :log "" Call :log "Another backup appears to already be running, script cannot continue..." call :log "...or, an old lock file has not been cleared, if so, please delete the..." call :log "...lock file '!z_lck_spec!', and try again..." goto :end ) copy nul "!z_lck_spec!" 1>nul 2>nul set z_bkf_drive=!z_bkf_path:~0,1! set z_cur_drive=!cd:~0,1! if /i "!z_cur_drive!"=="!z_bkf_drive!" goto :err_cannot_backup_self_to_self set z_bkf_prev_file=drive-!z_cur_drive!-prev.bkf set z_bkf_curr_file=drive-!z_cur_drive!-curr.bkf set z_bkf_prev_spec=!z_bkf_path!\!z_bkf_prev_file! set z_bkf_curr_spec=!z_bkf_path!\!z_bkf_curr_file! call :log "" call :log "Drive to backup: !z_cur_drive!:" call :log "Backup location: !z_bkf_curr_spec! if exist "!z_bkf_prev_spec!" ( if exist "!z_bkf_curr_spec!" ( call :log "" call :log "Deleting old previous backup..." if not "!z_debug!"=="YES" (del "!z_bkf_prev_spec!") call :log "The old previous backup of '!z_bkf_prev_spec!' has been deleted..." ) ) if exist "!z_bkf_curr_spec!" ( call :log "" call :log "Renaming old current backup..." if not "!z_debug!"=="YES" (rename "!z_bkf_curr_spec!" "!z_bkf_prev_file!") call :log "The old current backup has been renamed to '!z_bkf_prev_spec!'..." ) REM ************************************************** ************************************************** ****************** REM REM These are the "ntbackup" parameters and switches used ; REM parameters ; REM P1 backup Run a backup. REM P2 %z_cur_drive% The path (in this case a drive) to backup. REM switches ; REM /j "Description" The backup job description/title, used by ntbackup for the log file name. REM /f "savefile" The full path to the save file, i.e. a ".bkf" file that will contain the backup. REM /v:yes Verify the backup. REM /l:s Log file is "s" summary, "f" full, or "n" none. REM /m copy Backup type, one of either copy, full, differential, incremental or daily. REM REM REM The full log files can get pretty big, 2MB+ for a 2GB memory stick, so we just stick with summary log files of about 2KB. REM If the backup is aborted/cancelled then NTBackup does *not* set ErrorLevel, it's always zero. REM If the verify is aborted then nothing is written to the log file to indicate this. REM NTBackup appears to keep only ten rolling, looping, re-using log file numbers. REM NTBackup does not have a restore command line interface. The GUI has to be used to restore files. REM REM ************************************************** ************************************************** ****************** set z_cmd=ntbackup backup !z_cur_drive!: /j "Drive-!z_cur_drive!" /f "!z_bkf_curr_spec!" /v:yes /l:s /m copy set z_cmd_started=!time:~0,8! call :log "" call :log "Backup started at: !z_cmd_started!" call :log "" call :log "!z_cmd!" if not "!z_debug!"=="YES" (!z_cmd!) set z_cmd_finished=!time:~0,8! call :log "" call :log "Backup started at: !z_cmd_started!" call :log "Backup finished at: !z_cmd_finished!" call :check-ntbackup-log if exist "!z_lck_spec!" (del "!z_lck_spec!") :end call :log "" call :log "Script completed." call :log "************************************************* *****" echo+ pause color 07 exit /b REM ************************************************** ************************************************** ****************** :err_cannot_determine_backup_path call :log "Unable to determine target/save area for computer '!computername!'. Please amend this script and try again..." goto :end :err_cannot_backup_self_to_self call :log "Script cannot be used to backup drive '!z_cur_drive!' to target area '!z_bkf_path!'..." goto :end REM ************************************************** ************************************************** ****************** :check-ntbackup-log set z_failed=No if not "!userprofile!"=="" ( set z_ntb_path=!userprofile!\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data ) else ( set z_ntb_path=!homedrive!!homepath!\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data ) if not exist "!z_ntb_path!" ( call :log "" call :log "Determined the NTBackup log folder as '!z_ntb_path!', but folder does not exist..." call :log "...unable to check log file for errors, unable to confirm successful backup..." goto :eof ) REM There appear to be 10 rotating log files, we want the newest most recent... REM If the verification is aborted then there is nothing in the log file to indicate this... for /f "tokens=*" %%a in ('dir /o:d /b "!z_ntb_path!"') do ( set z_ntb_file=%%a ) set z_ntb_spec=!z_ntb_path!\!z_ntb_file! set /a z_cnt=0 for /f "tokens=*" %%a in ('type "!z_ntb_spec!"') do ( set /a z_cnt+=1 ) call :log "" call :log "Checking log: !z_ntb_spec!" call :log "Number of lines: !z_cnt!" set z_section= set z_media= set z_failed= set z_bck_comp= set z_bck_fail= set z_bck_dirs= set z_bck_files= set z_bck_bytes= set z_bck_mb= set z_bck_mbs= set z_bck_time= set z_bck_hhmmss= set z_ver_comp= set z_ver_fail= set z_ver_dirs= set z_ver_files= set z_ver_diff= set z_ver_bytes= set z_ver_mb= set z_ver_mbs= set z_ver_time= set z_ver_hhmmss= set z_cnt=0 for /f "tokens=1,2,3,4,5,6,7,8,*" %%a in ('type "!z_ntb_spec!"') do ( set /a z_cnt+=1 if /i "%%a %%b %%c %%d %%e %%f"=="The operation did not successfully complete." (set z_failed=Yes) if /i "%%a %%b"=="Media name:" ( set z_media=%%c set z_media=!z_media:~1,99! ) if /i "%%a %%b %%c"=="Active backup destination:" ( set z_media=%%d call :spec-to-file !z_media! set z_media=!z_result! ) if /i "%%a %%b"=="Backup Status" (set z_section=backup) if /i "%%a %%b"=="Verify Status" (set z_section=verify) if /i "%%a %%b"=="The operation was ended." ( if /i "!z_section!"=="Backup" (set z_bck_fail=Yes) if /i "!z_section!"=="Verify" (set z_ver_fail=Yes) ) if /i "%%a %%b"=="!z_section! completed" ( if /i "!z_section!"=="Backup" (set z_bck_comp=Yes) if /i "!z_section!"=="Verify" (set z_ver_comp=Yes) ) if /i "%%a"=="Directories:" ( if /i "!z_section!"=="Backup" (set z_bck_dirs=%%b) if /i "!z_section!"=="Verify" (set z_ver_dirs=%%b) ) if /i "%%a"=="Files:" ( if /i "!z_section!"=="Backup" (set z_bck_files=%%b) if /i "!z_section!"=="Verify" (set z_ver_files=%%b) ) if /i "%%a"=="Different:" ( if /i "!z_section!"=="Verify" (set z_ver_diff=%%b) ) if /i "%%a"=="Bytes:" ( if /i "!z_section!"=="Backup" (set z_bck_bytes=%%b) if /i "!z_section!"=="Verify" (set z_ver_bytes=%%b) ) if /i "%%a"=="Time:" ( set z_word=%%c set z_word=!z_word:~0,4! if /i "!z_word!"=="hour" (set z_job_duration=%%b:%%e:%%h) if /i "!z_word!"=="minu" (set z_job_duration=00:%%b:%%e) if /i "!z_word!"=="seco" (set z_job_duration=00:00:%%b) if /i "!z_section!"=="Backup" (set z_bck_duration=!z_job_duration!) if /i "!z_section!"=="Verify" (set z_ver_duration=!z_job_duration!) ) ) REM call :log "Media: !z_media!" REM call :log "BKF File: !z_bkf_curr_file!" if /i not "!z_media!"=="!z_bkf_curr_file!" ( call :log "" call :log "The newest log file '!z_ntb_file!' does not relate to this backup..." call :log "...two or more backups may have been run, or are currently running, at the same time..." call :log "...unable to confirm successful backup and/or verify..." goto :eof ) if /i "!z_bck_comp!"=="YES" ( Call :bytes-to-mb "!z_bck_bytes!" set z_bck_mb=!z_result! call :time-to-hhmmss "!z_bck_duration!" set z_bck_hhmmss=!z_result! call :calc-mbs "!z_bck_mb!" "!z_bck_hhmmss!" set z_bck_mbs=!z_result! ) if /i "!z_ver_comp!"=="YES" ( Call :bytes-to-mb "!z_ver_bytes!" set z_ver_mb=!z_result! call :time-to-hhmmss "!z_ver_duration!" set z_ver_hhmmss=!z_result! call :calc-mbs "!z_ver_mb!" "!z_ver_hhmmss!" set z_ver_mbs=!z_result! ) if not exist "!z_csv_spec!" ( echo Date,Start,End,Elapsed, ,User,Computer,Drive, ,Comp,Dirs,Files,MB,MM:SS,MB/s, ,Comp,Dirs,Files,MB,MM:SS,MB/s,Diff>>"!z_csv_spec!" ) set z_stats=!z_run_date!,!z_cmd_started!,!z_cmd_finish ed!,, set z_stats=!z_stats!,!username!,!computername!,!z_cur _drive!:, if /i "!z_failed!"=="YES" ( echo !z_stats!,FAILED>>"!z_csv_spec!" call :log "Backup and/or restore appears to have failed, deleting saveset '!z_bkf_curr_spec!'..." del "!z_bkf_curr_spec!" goto :eof ) set z_stats=!z_stats!,!z_bck_comp!,!z_bck_dirs!,!z_bck _files!,!z_bck_mb!,!z_bck_hhmmss!,!z_bck_mbs!, set z_stats=!z_stats!,!z_ver_comp!,!z_ver_dirs!,!z_ver _files!,!z_ver_mb!,!z_ver_hhmmss!,!z_ver_mbs!,!z_v er_diff! echo !z_stats!>>"!z_csv_spec!" call :log "" if /i "!z_bck_comp!"=="YES" ( call :log "Backup appears to have completed successfully:" call :log " Dirs: !z_bck_dirs!" call :log " Files: !z_bck_files!" call :log " Size: !z_bck_mb! MB" call :log " Time: !z_bck_hhmmss!" call :log " MB/s: !z_bck_mbs!" ) else ( call :log "Backup appears to have failed, please check log file now being openned in Notepad..." start "" /max notepad "!z_ntb_spec!" ) call :log "" if /i "!z_ver_comp!"=="YES" ( call :log "Verify appears to have completed successfully:" call :log " Dirs: !z_ver_dirs!" call :log " Files: !z_ver_files! Different: !z_ver_diff!" call :log " Size: !z_ver_mb! MB" call :log " Time: !z_ver_hhmmss!" call :log " MB/s: !z_ver_mbs!" ) else ( call :log "Verify appears to have failed, please check log file now being openned in Notepad..." start "" /max notepad "!z_ntb_spec!" ) goto :eof REM ************************************************** ************************************************** ****************** :bytes-to-mb set z_result= set z_bytes= for /f "tokens=1,2,3,4,5,6 delims=," %%a in (%1) do ( set z_bytes=%%a%%b%%c%%d%%e%%f ) set /a z_kb=!z_bytes!/1024 set /a z_result=!z_kb!/1024 goto :eof REM ************************************************** ************************************************** ****************** :time-to-hhmmss set z_result= for /f "tokens=1,2,3 delims=:" %%a in (%1) do ( set z_hh=0%%a set z_mm=0%%b set z_ss=0%%c ) set z_hh=!z_hh:~-2! set z_mm=!z_mm:~-2! set z_ss=!z_ss:~-2! set z_result=!z_hh!:!z_mm!:!z_ss! goto :eof REM ************************************************** ************************************************** ****************** :calc-mbs set z_tmp_mb=%~1 set z_tmp_hhmmss=%~2 set z_tmp_hh=!z_tmp_hhmmss:~0,2! set z_tmp_mm=!z_tmp_hhmmss:~3,2! set z_tmp_ss=!z_tmp_hhmmss:~6,2! set /a z_tmp_hh_secs=!z_tmp_hh!*3600 set /a z_tmp_mm_secs=!z_tmp_mm!*60 set z_tmp_secs=0 set /a z_tmp_secs=!z_tmp_secs!+!z_tmp_hh_secs! set /a z_tmp_secs=!z_tmp_secs!+!z_tmp_mm_secs! set /a z_tmp_secs=!z_tmp_secs!+!z_tmp_ss! set /a z_tmp_calc=!z_tmp_mb!*10 set /a z_tmp_calc=!z_tmp_calc!/!z_tmp_secs! set z_result=!z_tmp_calc:~0,-1!.!z_tmp_calc:~-1,99! if /i "!z_debug!"=="YES" ( echo MB = !z_tmp_mb! echo hhmmss = !z_tmp_hhmmss! echo s = !z_tmp_secs! echo MB/s = !z_result! ) goto :eof REM ************************************************** ************************************************** ****************** :spec-to-file set z_result=%~nx1 goto :eof REM ************************************************** ************************************************** ****************** :log echo !time:~0,8! %~1 echo !time:~0,8! %~1 >> "!z_log_spec!" goto :eof "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:uIxfqEBMIHA.820@TK2MSFTNGP06.phx.gbl... Thanks for the detailed analysis of the scenario.. it was really ful.... I would be grateful if u cud send me that DOS script... I wud hav questions in customising it... hmmmm... hope to hear soon..... Thanks once again... Stan "D.R." <a@b.c.d> wrote in message news:eLccj55LIHA.4684@TK2MSFTNGP06.phx.gbl... > Okay, the backup script is written in MS-Dos - I haven't converted it> to > VBScript yet. I prefer OpenVMS DCL as a scripting language, but these > days > most things I do are in VBScript. > > > > "Pegasus (MVP)" <I.can@fly.com> wrote in message > news:eVVFgo5LIHA.3516@TK2MSFTNGP02.phx.gbl... >> >> "D.R." <a@b.c.d> wrote in message >> news:uWIsVM5LIHA.5244@TK2MSFTNGP03.phx.gbl... >>> Stanley, >>> >>> Is the script supposed to start automatically in the background? >>> Or will ir be manually initiated? >>> If it fires automatically, who will be around (and logged on) to respond >>> to any dialog boxes? >>> What about using "ntbackup" to create compressed BKF files? >>> How many copies to reside on the file server? >>> Must the script keep at least one good copy, i.e. only remove/delete the >>> previous backup as long as the current backup actually works? >>> How much data are we talking about from the client? How many different >>> clients will run this backup? >>> >>> I have a DOS script that could run as a scheduled task, and thus you >>> could configure for the scheduled task to run as a particular user name >>> automatically, but it will stop working as soon as the password for the >>> account is changed. >>> >>> Let me know if you want a copy, it's a DOS script of medium complexity. >>> >>> Regards, >>> Dave. >>> >> >> I thought that DOS was an operating system that was retired some >> fifteen years ago? :-) >> > > |
|
|
|
#30 |
|
Messages: n/a
Hébergeur: |
Hey Al,
Just wondering what the official name is? I don't even know whether it can be called a scripting language? Can it? What is it? Thanks, Dave. "Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message news:ud6WSGKMIHA.1168@TK2MSFTNGP02.phx.gbl... > Since this thread has already degenerated to a bit of a hissy-fit argument > on the meaning of words like "deprecated" :-) I'll risk pointing out that > Pegasus' comment was not a slight against your use of batch scripting, but > against your referring to batch scripts as "DOS scripts". > > As for your latest reply below, I am at a loss to know how you could write > anything "in" "MS-Dos". MS-DOS is not a language, but an operating system. > And if you were indeed still using MS-DOS as your operating system, that > would be good enough reason not to have converted to VBScript, because > VBScript requires, at a minimum, Windows 98. > > > /Al > > "D.R." <a@b.c.d> wrote in message > news:eLccj55LIHA.4684@TK2MSFTNGP06.phx.gbl... >> Okay, the backup script is written in MS-Dos - I haven't converted it>> to VBScript yet. I prefer OpenVMS DCL as a scripting language, but these >> days most things I do are in VBScript. >> >> >> >> "Pegasus (MVP)" <I.can@fly.com> wrote in message >> news:eVVFgo5LIHA.3516@TK2MSFTNGP02.phx.gbl... >>> >>> "D.R." <a@b.c.d> wrote in message >>> news:uWIsVM5LIHA.5244@TK2MSFTNGP03.phx.gbl... >>>> Stanley, >>>> >>>> Is the script supposed to start automatically in the background? >>>> Or will ir be manually initiated? >>>> If it fires automatically, who will be around (and logged on) to >>>> respond to any dialog boxes? >>>> What about using "ntbackup" to create compressed BKF files? >>>> How many copies to reside on the file server? >>>> Must the script keep at least one good copy, i.e. only remove/delete >>>> the previous backup as long as the current backup actually works? >>>> How much data are we talking about from the client? How many different >>>> clients will run this backup? >>>> >>>> I have a DOS script that could run as a scheduled task, and thus you >>>> could configure for the scheduled task to run as a particular user name >>>> automatically, but it will stop working as soon as the password for the >>>> account is changed. >>>> >>>> Let me know if you want a copy, it's a DOS script of medium complexity. >>>> >>>> Regards, >>>> Dave. >>>> >>> >>> I thought that DOS was an operating system that was retired some >>> fifteen years ago? :-) >>> >> >> > > |
|
|
|
#31 |
|
Messages: n/a
Hébergeur: |
"D.R." <a@b.c.d> wrote in message news:%236Y0PVUMIHA.5244@TK2MSFTNGP03.phx.gbl... > Hi Stanley, > > I need to say that I'm fairly busy these days so I might not be able to > much (if at all) in customising it to suit your needs. The other > issue with scheduled batch files is that I think they generate "cmd" boxes > that can't be hidden from logged on users - unless I guess you run the > script under a different username that the user never sees, but if you do > that, then I'm not sure how the script can interact with a logged on > user - all questions that go beyond my experience/skill. > > Anyway, if you want to have a go with tweaking this script - feel > welcome... > What a monster of a batch file! Is it maintainable by anyone other than its author? Seeing that it uses advanced commands such as EnableDelayedExpansion and constructs like "set z_script_spec=%~dpnx0", it cannot possibly run under DOS as you initially suggested. |
|
|
|
#32 |
|
Messages: n/a
Hébergeur: |
Hi,
Ping runs fine in my machine.. but it cannot be invoked frm the vbscript file.. at line number 3 of the script you had given it throws the following error: " 'ping' is not recognized as an internal or external command, operable program or batch file." can u please tell me where I am going wrong? Thanks, Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%235jb7%23PMIHA.4688@TK2MSFTNGP06.phx.gbl... - Have a look where ping.exe resides. It should be in the System32 directory. - Check your %path%. It must include the c:\Windows\System32 directory. - Execute ping.exe directly from the Command Prompt. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:u93LgLPMIHA.4456@TK2MSFTNGP03.phx.gbl... Dear Pegasus, Thanks for the reply.. I am having a questio... at the line of Ping I get the following error: " 'ping' is not recognized as an internal or external command, operable program or batch file." Could you please .. I tried using it in a batch file and also as a vbs file. Thanks, Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%230ig292LIHA.5468@TK2MSFTNGP05.phx.gbl... Now why is that I feel like a dentist trying to extract a wisdom tooth? Here is a nice and simple solution: @echo off :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 echo. set /r reply=The network is not available. Try again? (Y/N) if /i "%reply%"=="Y" (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder 192.168.0.1 is the IP address of your server. Now if you prefer a dialog box instead of a Command Prompt to warn the user then you can do it by invoking a small .vbs script: @echo off echo wscript.quit(MsgBox("The network is not available. Try again?", 1, "Network Problem")) > c:\box.vbs :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 cscript.exe //nologo c:\box.vbs if %ErrorLevel%==1 (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder I haven not had the time to fully test this script. If you want the whole lot in a .vbs script file then you need a lot more than just six lines of code. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:O51DJL2LIHA.4684@TK2MSFTNGP06.phx.gbl... Sorry for the confusion... let me xplain once more... The script will be scheduled to run on a weekly basis at 8.00 AM on all the workstations. The msg is supposed to pop up, whenevr the network is not available. The user has to respond to the msgbox, to either Abort the operation, retry the operation or cancel it. Here the user will respond to it... The thought process is that.. if the user has not connected the network cable, and the msg pops up, then he can check his network conection and then retry it... Thanks .... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:eQahME2LIHA.4196@TK2MSFTNGP04.phx.gbl... When you require a script then it s to provide plenty of background information. It is now clear why you might get this dialog box. Now please try to answer my remaining questions - this is ESSENTIAL! - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:Of7t6s1LIHA.4272@TK2MSFTNGP05.phx.gbl... leme explain... In case the network conectivity is not available, and the scheduled backup fires up.... then it should give a msg in a msgbox telling that "Network connectivity unavailable, Try again?" with the buttons Abort, retry and cancel. Hope i have made it clear.. My intention in doing this is to make backup of the pst files of MS outlook of all workstations (in our case all are laptops).... Thanks once again... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:uJjN%23J0LIHA.5224@TK2MSFTNGP02.phx.gbl... Your request is unclear. - What generates the "Abort, retry, Cancel" dialog box? - Why? - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:%23GsGbE0LIHA.2432@TK2MSFTNGP04.phx.gbl... thanks very much pegasus.. I wanted the vbscript for the "Abort, retry, Cancel" command box and to check for the network connectivity before the xcopy is fired... Could anyone please guide me to a good scripting resource. I hav experience working in vb. Thanks Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%236SY2YzLIHA.4228@TK2MSFTNGP02.phx.gbl... A batch file would be considerably simpler: @echo off xcopy /s /d /y /c "d:\My Files" \\My Server\Some Share\Some Folder Make sure to schedule the command under an account that has sufficient privileges to access the the source & target areas. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:OwKD6WyLIHA.4752@TK2MSFTNGP05.phx.gbl... Dear all, I wanted the vbscript for script for scheduled backing up local content files to the network file storage on a weekly basis. Could anyone please .... Thanks.. Stan |
|
|
|
#33 |
|
Messages: n/a
Hébergeur: |
I think we are running round in circlues. You keep mixing batch
files with script files. I gave you a batch file, not a script file (even though it had a section that will generate a script file). It's now back to where we started: If you have a problem then you MUST post the file you currently use, and you MUST tell us if you saved it as a batch file (.bat) or as a script file (.vbs). "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:%23XjIG7bMIHA.5988@TK2MSFTNGP02.phx.gbl... Hi, Ping runs fine in my machine.. but it cannot be invoked frm the vbscript file.. at line number 3 of the script you had given it throws the following error: " 'ping' is not recognized as an internal or external command, operable program or batch file." can u please tell me where I am going wrong? Thanks, Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%235jb7%23PMIHA.4688@TK2MSFTNGP06.phx.gbl... - Have a look where ping.exe resides. It should be in the System32 directory. - Check your %path%. It must include the c:\Windows\System32 directory. - Execute ping.exe directly from the Command Prompt. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:u93LgLPMIHA.4456@TK2MSFTNGP03.phx.gbl... Dear Pegasus, Thanks for the reply.. I am having a questio... at the line of Ping I get the following error: " 'ping' is not recognized as an internal or external command, operable program or batch file." Could you please .. I tried using it in a batch file and also as a vbs file. Thanks, Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%230ig292LIHA.5468@TK2MSFTNGP05.phx.gbl... Now why is that I feel like a dentist trying to extract a wisdom tooth? Here is a nice and simple solution: @echo off :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 echo. set /r reply=The network is not available. Try again? (Y/N) if /i "%reply%"=="Y" (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder 192.168.0.1 is the IP address of your server. Now if you prefer a dialog box instead of a Command Prompt to warn the user then you can do it by invoking a small .vbs script: @echo off echo wscript.quit(MsgBox("The network is not available. Try again?", 1, "Network Problem")) > c:\box.vbs :again ping 192.168.0.1 | find /i "bytes=" && goto Label1 cscript.exe //nologo c:\box.vbs if %ErrorLevel%==1 (goto again) else (goto :eof) :Label1 xcopy /s /d /y /c "D:\My Files" \\My Server\Some Share\Some Folder I haven not had the time to fully test this script. If you want the whole lot in a .vbs script file then you need a lot more than just six lines of code. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:O51DJL2LIHA.4684@TK2MSFTNGP06.phx.gbl... Sorry for the confusion... let me xplain once more... The script will be scheduled to run on a weekly basis at 8.00 AM on all the workstations. The msg is supposed to pop up, whenevr the network is not available. The user has to respond to the msgbox, to either Abort the operation, retry the operation or cancel it. Here the user will respond to it... The thought process is that.. if the user has not connected the network cable, and the msg pops up, then he can check his network conection and then retry it... Thanks .... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:eQahME2LIHA.4196@TK2MSFTNGP04.phx.gbl... When you require a script then it s to provide plenty of background information. It is now clear why you might get this dialog box. Now please try to answer my remaining questions - this is ESSENTIAL! - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:Of7t6s1LIHA.4272@TK2MSFTNGP05.phx.gbl... leme explain... In case the network conectivity is not available, and the scheduled backup fires up.... then it should give a msg in a msgbox telling that "Network connectivity unavailable, Try again?" with the buttons Abort, retry and cancel. Hope i have made it clear.. My intention in doing this is to make backup of the pst files of MS outlook of all workstations (in our case all are laptops).... Thanks once again... Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:uJjN%23J0LIHA.5224@TK2MSFTNGP02.phx.gbl... Your request is unclear. - What generates the "Abort, retry, Cancel" dialog box? - Why? - Do you expect the script to respond to it automatically? - How? "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:%23GsGbE0LIHA.2432@TK2MSFTNGP04.phx.gbl... thanks very much pegasus.. I wanted the vbscript for the "Abort, retry, Cancel" command box and to check for the network connectivity before the xcopy is fired... Could anyone please guide me to a good scripting resource. I hav experience working in vb. Thanks Stan "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%236SY2YzLIHA.4228@TK2MSFTNGP02.phx.gbl... A batch file would be considerably simpler: @echo off xcopy /s /d /y /c "d:\My Files" \\My Server\Some Share\Some Folder Make sure to schedule the command under an account that has sufficient privileges to access the the source & target areas. "Stanley Samuel" <webdev_mct@yahoo.com> wrote in message news:OwKD6WyLIHA.4752@TK2MSFTNGP05.phx.gbl... Dear all, I wanted the vbscript for script for scheduled backing up local content files to the network file storage on a weekly basis. Could anyone please .... Thanks.. Stan |
|
|
|
#34 |
|
Messages: n/a
Hébergeur: |
While there might be some differences of opinion on what to call a batch
script or a batch file, I think the consensus would be that either term, "batch script" or "batch file" is acceptable: http://en.wikipedia.org/wiki/.bat Note that this wikipedia page does indeed mention MS-DOS and DOS, however, to say that what we are discussing in these newsgroups (all of which have "windows" in their names) is DOS scripting, makes not much more sense than calling it os2 scripting or unix scripting. One could, I suppose, call it windows batch scripting, but then the version from windows 95 is probably much closer to the old DOS version than it is to the XP version. So I think the best thing to call it is "batch script" or something as generic. And yes, it is a scripting language; not as robust and complete as others, perhaps, but it is certainly not a programming language. /Al "D.R." <a@b.c.d> wrote in message news:edlwQVUMIHA.5244@TK2MSFTNGP03.phx.gbl... > Hey Al, > Just wondering what the official name is? I don't even know whether it > can be called a scripting language? Can it? What is it? > Thanks, > Dave. > > > "Al Dunbar" <AlanDrub@hotmail.com.nospaam> wrote in message > news:ud6WSGKMIHA.1168@TK2MSFTNGP02.phx.gbl... >> Since this thread has already degenerated to a bit of a hissy-fit >> argument on the meaning of words like "deprecated" :-) I'll risk pointing >> out that Pegasus' comment was not a slight against your use of batch >> scripting, but against your referring to batch scripts as "DOS scripts". >> >> As for your latest reply below, I am at a loss to know how you could >> write anything "in" "MS-Dos". MS-DOS is not a language, but an operating >> system. And if you were indeed still using MS-DOS as your operating >> system, that would be good enough reason not to have converted to >> VBScript, because VBScript requires, at a minimum, Windows 98. >> >> >> /Al >> >> "D.R." <a@b.c.d> wrote in message >> news:eLccj55LIHA.4684@TK2MSFTNGP06.phx.gbl... >>> Okay, the backup script is written in MS-Dos - I haven't converted>>> it to VBScript yet. I prefer OpenVMS DCL as a scripting language, but >>> these days most things I do are in VBScript. >>> >>> >>> >>> "Pegasus (MVP)" <I.can@fly.com> wrote in message >>> news:eVVFgo5LIHA.3516@TK2MSFTNGP02.phx.gbl... >>>> >>>> "D.R." <a@b.c.d> wrote in message >>>> news:uWIsVM5LIHA.5244@TK2MSFTNGP03.phx.gbl... >>>>> Stanley, >>>>> >>>>> Is the script supposed to start automatically in the background? >>>>> Or will ir be manually initiated? >>>>> If it fires automatically, who will be around (and logged on) to >>>>> respond to any dialog boxes? >>>>> What about using "ntbackup" to create compressed BKF files? >>>>> How many copies to reside on the file server? >>>>> Must the script keep at least one good copy, i.e. only remove/delete >>>>> the previous backup as long as the current backup actually works? >>>>> How much data are we talking about from the client? How many >>>>> different clients will run this backup? >>>>> >>>>> I have a DOS script that could run as a scheduled task, and thus you >>>>> could configure for the scheduled task to run as a particular user >>>>> name automatically, but it will stop working as soon as the password >>>>> for the account is changed. >>>>> >>>>> Let me know if you want a copy, it's a DOS script of medium >>>>> complexity. >>>>> >>>>> Regards, >>>>> Dave. >>>>> >>>> >>>> I thought that DOS was an operating system that was retired some >>>> fifteen years ago? :-) >>>> >>> >>> >> >> > > |
|
|
|
#35 |
|
Messages: n/a
Hébergeur: |
It is actually pretty hard now-a-days to find a computer running MS-DOS
For me it was at least a couple of years ago...... Lets not forget MS-DOS or DOS is an operating system, what do you think the OS means in DOS ? CMD is a "Command Prompt" I think the most appropriate names should not reflect any "DOS" reference, as it is very unlikely you are running MS-DOS as an operating system and it is even more unlikely that the said files (batch or script, whatever you call them) would even run MS-DOS due to syntax incompatibilities with the CMD command line interpeter. So, my money (with a 2 cent maximum) would be on - CMD batch [file] - CMD script [file] - batch file - batch script [file] Although one could argue that a true "batch" file would have the .BAT extension... which offcourse comes with a syntax change and is really a different "scripting language" commared to CMD command line interpeter. ;-) "J de Boyne Pollard" <j.deboynepollard@tesco.net> wrote in message news:d2b7684d-28e1-4a7d-b5d7-3b235dd4d1f6@e10g2000prf.googlegroups.com... > AD> I think the consensus would be that either term, > AD> "batch script" or "batch file" is acceptable: > AD> http://en.wikipedia.org/wiki/.bat > > Never blindly trust a Wikipedia article that cites no sources. That's > a good indication that people have been writing it off the cuff, > rather than writing it based upon authoritative knowledge. > > AD> So I think the best thing to call it is "batch script" or > AD> something as generic. > > The command interpreter, whose scripting language it is, is CMD. So > it's a CMD script. Historically, it is known as a "batch file", albeit > that this is a misnomer, since MS-DOS doesn't have a batch mode for > running tasks in. |
|
|
|
#36 |
|
Messages: n/a
Hébergeur: |
Thank you for the updates/education, all three of you - I guess I'll use the
term "batch script" in future. Thanks again. |
|
|
|
#37 |
|
Messages: n/a
Hébergeur: |
On Thu, 29 Nov 2007 17:08:22 -0800, J de Boyne Pollard wrote:
> JdeBP> The command interpreter, whose scripting language JdeBP> it is, is > CMD. So it's a CMD script. Historically, it is JdeBP> known as a "batch > file", albeit that this is a misnomer, JdeBP> since MS-DOS doesn't have a > batch mode for JdeBP> running tasks in. > > EM> [...] Lets not forget MS-DOS or DOS is an operating EM> system, [...] > > <URL:http://homepages.tesco.net./~J.deBoy...-cli-is-not-a- > dos-prompt.html> > > I think that I'm unlikely to do so. > > That doesn't relate to the point that I was making, however, which was > that unlike mainframe and minicomputer operating systems, which have batch > mode facilities for jobs to be "run in batch", MS-DOS has no batch mode > facilities. So although "batch file" was the name originally adopted for > COMMAND scripts on PC/MS-DOS, this is a misnomer. > > EM> CMD is a "Command Prompt" > > <URL:http://homepages.tesco.net./~J.deBoy...d/FGA/command- > prompts.html> > > It is a command _interpreter_. > >> > A true batch file would involve actually running jobs in batch mode. > > EM> ... which offcourse comes with a syntax change EM> and is really a > different "scripting language" EM> commared to CMD command line > interpeter. > > The scripting languages provided by Microsoft's CMD, IBM's CMD, my CMD, > the Reactos CMD, Microsoft's COMMAND, IBM's COMMAND, the FreeDOS COMMAND, > 4DOS, 4OS2, and 4NT are all different, albeit that they share certain core > aspects to greater or lesser extents. These are all command interpreters > providing scripting languages. So I generally use "command script" or > just "script" as the generic name and "COMMAND script", "CMD script", > "4OS2 script", and so forth when it is necessary to be specific about > which command interpreter's scripting language it actually is. I would like to point ot a flaw in your logic: even on the oldest mainframes, batch operation was under the control of a program that interpreted the batch operating commands and variables - that is, under the control of a command interepreter. The best known (and most hated) of those mainframe batch languages (and intrepreters) is JCL (<http://en.wikipedia.org/wiki/Job_Control_Language>). In comparison with that monstrosity, CMD's batch language is positively beneign. If JCL is a scripting language, then so are the various flavors of DOS and DOS-like batch languages. -- T.E.D. (tdavis@umr.edu) UMR becomes MST soon. |
|
|
|
#38 |
|
Messages: n/a
Hébergeur: |
Ted Davis wrote:
> On Thu, 29 Nov 2007 17:08:22 -0800, J de Boyne Pollard wrote: > >> JdeBP> The command interpreter, whose scripting language JdeBP> it is, is >> CMD. So it's a CMD script. Historically, it is JdeBP> known as a "batch >> file", albeit that this is a misnomer, JdeBP> since MS-DOS doesn't have a >> batch mode for JdeBP> running tasks in. >> >> EM> [...] Lets not forget MS-DOS or DOS is an operating EM> system, [...] >> >> <URL:http://homepages.tesco.net./~J.deBoy...-cli-is-not-a- >> dos-prompt.html> >> >> I think that I'm unlikely to do so. >> >> That doesn't relate to the point that I was making, however, which was >> that unlike mainframe and minicomputer operating systems, which have batch >> mode facilities for jobs to be "run in batch", MS-DOS has no batch mode >> facilities. So although "batch file" was the name originally adopted for >> COMMAND scripts on PC/MS-DOS, this is a misnomer. It took until (rummages as my memory isn't so good these days) MSDOS 6.0 before Microsoft was cajouled into creating a choice.com. Prior to that (though there was lot of user demand for menus) it was indeed for batch processing, i.e. beyond the basic debugging "pause" command there was no user interaction. >> >> EM> CMD is a "Command Prompt" >> >> <URL:http://homepages.tesco.net./~J.deBoy...d/FGA/command- >> prompts.html> >> >> It is a command _interpreter_. >> >> A true batch file would involve actually running jobs in batch mode. >> >> EM> ... which offcourse comes with a syntax change EM> and is really a >> different "scripting language" EM> commared to CMD command line >> interpeter. >> >> The scripting languages provided by Microsoft's CMD, IBM's CMD, my CMD, >> the Reactos CMD, Microsoft's COMMAND, IBM's COMMAND, the FreeDOS COMMAND, >> 4DOS, 4OS2, and 4NT are all different, albeit that they share certain core >> aspects to greater or lesser extents. These are all command interpreters >> providing scripting languages. So I generally use "command script" or >> just "script" as the generic name and "COMMAND script", "CMD script", >> "4OS2 script", and so forth when it is necessary to be specific about >> which command interpreter's scripting language it actually is. > > I would like to point ot a flaw in your logic: even on the oldest > mainframes, batch operation was under the control of a program that > interpreted the batch operating commands and variables - that is, under > the control of a command interepreter. The best known (and most hated) of > those mainframe batch languages (and intrepreters) is JCL > (<http://en.wikipedia.org/wiki/Job_Control_Language>). > > In comparison with that monstrosity, CMD's batch language is positively > beneign. If JCL is a scripting language, then so are the various flavors > of DOS and DOS-like batch languages. > |
|