Jump to content
Sign in to follow this  
bhoney

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

Recommended Posts

bhoney

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

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
bhoney

Thanks guys! I didnt upload the avatar :) I created the forum acct by linking my FB acct so i didnt have to fill out all of the normal stuff and apparently when you do that it pulls over your current profile picture.

Share this post


Link to post
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
Sign in to follow this  

×