Jump to content

Advice on if Autoit is the way to go...


bhoney
 Share

Recommended Posts

So I would like to start by saying im not a expert coder or anything I have just messed with batch files. Currently I have a batch file I wrote to help my users backup data to a server utilizing robocopy. I would like to take it up a notch and make a gui for it somehow. Is autoit the way to go for this?

below is my current batch file contents...

Any advice would be appreciated.

@echo off
mode con:cols=90 lines=40
color 71
set username=%username%
set drive1=c
Set drive2=D

pskill.exe /accepteula communicator.exe
pskill.exe /accepteula outlook.exe
cls

:start
ECHO                               Data Backup Tool                        
ECHO.    
ECHO                 ****************** STOP!!! *******************

Echo Please make sure Outlook and all other Applications are closed.
Echo If all applications are closed select Y to continue or select N to exit backup.

set choice=
set /p choice=Select Y or N and then select ENTER
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='Y' goto Continue
if '%choice%'=='N' goto Exit
if '%choice%'=='y' goto Continue
if '%choice%'=='n' goto Exit
ECHO "%choice%" is not valid please try again
ECHO.
GOTO START

:CONTINUE

set choice=
set /p choice=Has your NT login name ever changed (Y or N)?
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='Y' goto EnterName
if '%choice%'=='N' goto Continue1
if '%choice%'=='y' goto EnterName
if '%choice%'=='n' goto continue1
ECHO "%choice%" is not valid please try again
ECHO.
GOTO CONTINUE

:EnterName
set /p UN=Previous Username (ex john_smith):

ver|%windir%system32find.exe "XP"
if errorlevel 1 goto 71
goto XP1

:71
md NVBACKUPUserData$%username%data

ROBOCOPY "%drive1%:Users%UN%" "NVBACKUPUserData$%username%Users%username%" *.DWG *.4PK *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.PNG *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RM *.RQY *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xf ntuser.* *.tmp /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" "%drive1%:Users%username%AppData" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY "%drive1%:Users%UN%.AMERICAS" "NVBACKUPUserData$%username%Users%username%.AMERICAS" *.DWG *.4PK *.ADP *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.mp3 *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

goto continue1

:XP1
md NVBACKUPUserData$%username%data

ROBOCOPY "%drive1%:Documents and Settings%UN%" "NVBACKUPUserData$%username%Documents and Settings%username%" *.DWG *.N2K *.4PK *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.PST *.REG *.RM *.RQY *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xf ntuser.* *.tmp /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY "%drive1%:Documents and Settings%UN%.AMERICAS" "NVBACKUPUserData$%username%Documents and Settings%username%.AMERICAS" *.DWG *.4PK *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

goto continue1

:continue1

Echo Backing up Printers, Network Drives and Outlook Profile information


ver|%windir%system32find.exe "XP"
if errorlevel 1 goto 7
goto XP

:7
md NVBACKUPUserData$%username%data

reg export HKCUnetwork "%drive1%:Users%username%Documents"networkdrives.reg /y
reg export HKCUprintersconnections "%drive1%:Users%username%Documents"Printers.reg /Y
reg export "HKCUSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles" "%drive1%:Users%username%Documents"Outlookprofile.reg /y

ROBOCOPY %drive1%:DATA NVBACKUPUserData$%username%data *.* /S /z /r:1 /w:1 /xf  *.tmp /LOG:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY %drive1%: NVBACKUPUserData$%username% *.DWG *.4PK *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.mp3 *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.PNG *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /S /z /r:1 /w:1 /xf *.tmp *.sys /xd ADMINPAK CAPS DATA DELL Users DRV LOGS "LOST AND FOUND" MSOCACHE OV4 "PROGRAM FILES" RECYCLER SMSADMIN "SYSTEM VOLUME INFORMATION" WINDOWS WINNT $Recycle.Bin boot Config.Msi Drivers PerfLogs ProgramData Recovery TEMP "Program Files (x86)" "Documents and Settings" "%drive1%:Users%username%AppData" "%drive1%:_SMSTaskSequence" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY "%drive1%:Users%username%" "NVBACKUPUserData$%username%Users%username%" *.DWG *.4PK *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.PNG *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RM *.RQY *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xf ntuser.* *.tmp /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" "%drive1%:Users%username%AppData" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY "%drive1%:Users%username%.AMERICAS" "NVBACKUPUserData$%username%Users%username%.AMERICAS" *.DWG *.4PK *.ADP *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.mp3 *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY %drive1%: NVBACKUPUserData$%username% *.PST *.NK2 /S /z /r:1 /w:1 /xf *.tmp *.sys *.4PK *.ADP *.DWG *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.mp3 *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.PNG *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /xd CAPS DRV LOGS "LOST AND FOUND" MSOCACHE RECYCLER SMSADMIN "SYSTEM VOLUME INFORMATION" WINDOWS WINNT $Recycle.Bin boot Config.Msi Drivers PerfLogs ProgramData "%drive1%:UsersPublic" "%drive1%:UsersDefault" "%drive1%:UsersDefault User" "%drive1%:UsersAll Users" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

GOTO END

:XP
md NVBACKUPUserData$%username%data

reg export HKCUnetwork "%drive1%:Documents and Settings%username%My Documents"networkdrives.reg /y
reg export HKCUprintersconnections "%drive1%:Documents and Settings%username%My Documents"Printers.reg /y
reg export "HKCUSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles" "%drive1%:Documents and Settings%username%My Documents"Outlookprofile.reg /y



ROBOCOPY %drive1%:DATA NVBACKUPUserData$%username%data *.* /S /z /r:1 /w:1 /xf *.tmp /LOG:NVBACKUPUserData$%username%databackuplog.txt  /TEE


ROBOCOPY %drive1%: NVBACKUPUserData$%username% *.DWG *.N2K *.4PK *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.wma *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /S /z /r:1 /w:1 /xf *.tmp *.sys /xd ADMINPAK CAPS DATA DELL "DOCUMENTS AND SETTINGS" DRV LOGS "LOST AND FOUND" MSOCACHE OV4 "PROGRAM FILES" RECYCLER SMSADMIN "SYSTEM VOLUME INFORMATION" WINDOWS WINNT /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE


ROBOCOPY "%drive1%:Documents and Settings%username%" "NVBACKUPUserData$%username%Documents and Settings%username%" *.N2K *.4PK *.ADP *.AVI *.DWG *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.PST *.REG *.RM *.RQY *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xf ntuser.* *.tmp /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY "%drive1%:Documents and Settings%username%.AMERICAS" "NVBACKUPUserData$%username%Documents and Settings%username%.AMERICAS" *.4PK *.DWG *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* /s /z /r:1 /w:1 /xd cookies nethood printhood sendto "start menu" templates userdata .javaws "Local Settings" /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

ROBOCOPY %drive1%: NVBACKUPUserData$%username% *.PST *.NK2 /S /z /r:1 /w:1 /xf *.4PK *.ADP *.AVI *.BAT *.CSV *.CTT *.DOC *.docm *.docx *.DOT *.dotx *.DQY *.GIF *.DWG *.IQY *.JPEG *.JPG *.LDF *.MAF *.MDB *.MDE *.MDI *.MDT *.MOV *.mp3 *.MPEG *.m4a *.m4p *.MPG *.MPP *.MSG *.ONE *.OQY *.PAB *.PDF *.POT *.potx *.PPA *.ppam *.PPS *.ppsm *.ppsx *.PPT *.pptm *.pptx *.PRC *.REG *.RQY *.RM *.RTF *.SQL *.TIF *.TXT *.URL *.VBS *.VSD *.wma *.WMV *.xlam *.XLS *.xlsb *.xlsm *.xlsx *.XLT *.xltm *.xltx *.ZIP TNS*.* *.tmp *.sys /xd ADMINPAK CAPS DRV LOGS "LOST AND FOUND" MSOCACHE OV4 RECYCLER SMSADMIN "SYSTEM VOLUME INFORMATION" WINDOWS WINNT /LOG+:NVBACKUPUserData$%username%databackuplog.txt  /TEE

GOTO END


:END
cls
type finished.txt    

echo.

pause

:Exit
Edited by Jos
inserted CODE box
Link to comment
Share on other sites

Welcome to AutoIt and the forum!

I would like to take it up a notch and make a gui for it somehow. Is autoit the way to go for this?

Sure. That can be done using AutoIt.

If you have AutoIt and the full SciTE package installed you can click "alt+m" in SciTE and "Koda" - the GUI designer - will be started. Koda will create the AutoIt code for you.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Autoit Is sure a great way to go, even if you just use a gui to control your batch files.

Yes!

Off topic, I've always wanted to ask this.

Why, when you join a forum to ask a question, is the first thing you do, upload an avatar?

Serious question is you care to answer.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...