Jump to content

Please help i need space between source and destination. Below script i am getting error parameter is incorrect - (Moved)


Recommended Posts

Please find the attachment script when i execute the script i am getting error parameter is incorrect

 RunWait('robocopy "' & @UserProfileDir & '\Desktop"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Desktop" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log:Backup.txt', "", @SW_SHOWNORMAL)

Backup&Restore_v1.0.au3

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states:

Quote

Share your cool AutoIt scripts, UDFs and applications with others.


Do not post general support questions here, instead use the AutoIt Help and Support forums.

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

;
        Case $msg = $Button_2
            OpenFile1()
            Func OpenFile1()
                $Path = @DesktopDir & "\varma\Backup.txt"
                ShellExecute($Path)
            EndFunc   ;==>OpenFile1

        Case $msg = $Button_3

??

 

EDIT:
Func OpenFile1()
and
Func OpenFile2()

Should not be declared inside of another function.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Please put Robocopy.exe in script directory.

attached backuplog.txt file for error reference. Please help me out to resolve this issue.

C:\Users\V13743\Desktop\C:\Backup\HP4E302407\V13743\Desktop\*.*
        *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /XO /XJ /R:2 /W:2 C:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logC:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logThe parameter is incorrect.

 

 

RoboBackup&Restore.txt Backuplog.txt

Link to comment
Share on other sites

I am new to AutoIT script and i have less knowledge on scripting somehow developed attached code. Could you please modify my existing code. 

I am getting parameter is incorrect while executing. Some machines it's working some machines it's getting parameter is incorrect. Log shown below.

C:\Users\V13743\Desktop\C:\Backup\HP4E302407\V13743\Desktop\*.*
        *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /XO /XJ /R:2 /W:2 C:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logC:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logThe parameter is incorrect.

Link to comment
Share on other sites

tell me if i am wrong i think as below log shows there is not gap between Desktop\C:\Backup is this is the issue for parameter is incorrect error?

C:\Users\V13743\Desktop\C:\Backup\HP4E302407\V13743\Desktop\*.*
        *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /XO /XJ /R:2 /W:2 C:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logC:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logThe parameter is incorrect.

Link to comment
Share on other sites

.....
.....
            ; RunWait('robocopy "' & $var2 & "\" & @UserName & '\Desktop"' & ' "' & @UserProfileDir & '\Desktop" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2 /log:Restore.txt', "", @SW_SHOWNORMAL)
            _Run_Robocopy( _
                    $var2 & '\' & @UserName & '\Desktop\', _
                    @UserProfileDir & '\Desktop', _
                    Default)
.....
.....
.....
.....
.....
.....
.....
Func _Run_Robocopy($source, $destination, $parameters = Default)
    if parameters = Default then $parameters = '*.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restore.txt'
    RunWait('robocopy "' & $source  & '" "' & $destination & '" ' & $parameters, '', @SW_SHOWNORMAL)
EndFunc

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Thanks mLipok...Restore it's working fine. But i given backuplog i am having issues with backup.

I think there is no spaces between source and destination that's why it's getting parameter is incorrect. I am trying to put space. Please anyhow help me to put space in my backup script below.

RunWait('robocopy "' & @UserProfileDir & '\Desktop"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Desktop" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log:Backup.txt', "", @SW_SHOWNORMAL)

 

Log

C:\Users\V13743\Desktop\C:\Backup\HP4E302407\V13743\Desktop\*.*
        *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /NP /XO /XJ /R:2 /W:2 C:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logC:\Users\V13743\Desktop\Backup_Log_31_08_2020_12-41-06.logThe parameter is incorrect.

Backup&Restore_v1.0.txt

Link to comment
Share on other sites

There is a space in that line.

Here use this function to debug the text:

$var1 = EnvGet("systemdrive")

RunWaitCW('robocopy "' & @UserProfileDir & '\Desktop"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Desktop" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log:Backup.txt', "", @SW_SHOWNORMAL)

Func RunWaitCW($txt,$a,$b)
    ConsoleWrite($txt & @CRLF)
EndFunc   ;==>RunWaitCW

(you have to rename all RunWAit calls as RunWaitCW(), and comment out the filedelete lines.

Edited by Dan_555

Some of my script sourcecode

Link to comment
Share on other sites

Thanks Dan_555 but it's not working. I given as below is it correct?

While 1
    $msg = GUIGetMsg()
    Select
      Case $msg = $Button_1
        RunWaitCW('robocopy "' & @UserProfileDir & '\Desktop"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Desktop" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log:Backup.txt', "", @SW_SHOWNORMAL)
        Func RunWaitCW($txt,$a,$b)
    ConsoleWrite($txt & @CRLF)
EndFunc   ;==>RunWaitCW
        MsgBox(0, "Job Status", "Backup Done ...", 2)
        ;FileDelete($file)
        

Link to comment
Share on other sites

40 minutes ago, BhanuSrikanth said:

tell me if i am wrong i think as below log shows there is not gap between Desktop\C:\Backup is this is the issue for parameter is incorrect error?

I agree. However, I didn't run into that issue when running your script. So either we aren't running the same version or there is something

Have you downloaded Scite like I recommended previously? If so, show use the results from the output panel.

P.S. You need to stop begging for help and start showing some effort on your part. Continually reposting the same thing and expecting someone to fix your code gets old real fast. :naughty:

Link to comment
Share on other sites

And when you copy and paste things:

The lines in between (including) Func and End Func should be pasted at the end of the code. 

The RunWaitCW does only write a text in the Scite's console window. 

 

This is the cleaned up version, but it is only for testing:

;==================================================
;==================================================
#include <GDIPlus.au3>
#include <MsgBoxConstants.au3>
$prompt = MsgBox(4129, "Warning", "Close all your applications before using this tool")
If $prompt = "2" Then Exit
Dim $hGUI, $hImage, $hGraphic, $Button_1, $Button_2, $Button_3, $Button_4, $Button_5, $font, $var1, $var2, $file
$var1 = EnvGet("systemdrive") ;
;==================================================
;If Not FileExists(@SystemDir & '\robocopy.exe') Then FileInstall('Robocopy.exe', @SystemDir & '\Robocopy.exe', 0)
#include <GuiConstants.au3>

$hGUI = GUICreate("Backup&Restore_v1.0", 320, 300, (@DesktopWidth - 320) / 2, (@DesktopHeight - 300) / 2, $WS_SIZEBOX + $WS_SYSMENU)
GUISetState()
$font = "Arial Bold"
GUISetFont(12, 600, "", $font)
GUISetBkColor(0xE0FFFF)  ;

; Load PNG image
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\test.png")

; Draw PNG image
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 20, 20)

$Button_1 = GUICtrlCreateButton("Backup", 180, 20, 90, 40)
$Button_2 = GUICtrlCreateButton("Backuplog", 180, 70, 90, 40)
$Button_3 = GUICtrlCreateButton("Restore", 180, 120, 90, 40)
$Button_4 = GUICtrlCreateButton("Restorelog", 180, 170, 90, 40)
$Button_5 = GUICtrlCreateButton("Quit", 80, 210, 90, 40)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button_1
            RunWaitCW('robocopy "' & @UserProfileDir & '\Desktop"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Desktop" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Citrix"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Citrix" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Contacts"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Contacts" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Documents"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Documents" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\3D Objects"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\3D Objects" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Downloads"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Downloads" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT //MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Favorites"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Favorites" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Links"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Links" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Music"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Music" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\OneDrive"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\OneDrive" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Pictures"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Pictures" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Saved Games"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Saved Games" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Searches"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Searches" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & @UserProfileDir & '\Videos"' & ' "' & $var1 & "\" & "Backup" & "\" & @ComputerName & "\" & @UserName & '\Videos" *.* /NDL /TEE /S /E /DCOPY:DA /COPY:DAT /MIR /NP /XO /XJ /R:2 /W:2 /log+:Backuplog.txt', "", @SW_SHOWNORMAL)
            MsgBox(0, "Job Status", "Backup Done ...", 2)
            ;FileDelete($file)

        Case $msg = $Button_2
            OpenFile1()

        Case $msg = $Button_3
            $var2 = EnvGet("systemdrive") ;
            $var2 = FileSelectFolder('Select a target path.', ' ', 2)
            If @error = 1 Then
                MsgBox(0, "User Cancelled", "User cancelled, Exiting Program", 3)
                Exit
            EndIf
            ;FileClose($file)
            ;FileDelete($file)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Desktop"' & ' "' & @UserProfileDir & '\Desktop" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2 /log:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Citrix"' & ' "' & @UserProfileDir & '\Citrix" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Contacts"' & ' "' & @UserProfileDir & '\Contacts" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Documents"' & ' "' & @UserProfileDir & '\Documents" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\3D Objects"' & ' "' & @UserProfileDir & '\3D Objects" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Downloads"' & ' "' & @UserProfileDir & '\Downloads" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Links"' & ' "' & @UserProfileDir & '\Links" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Music"' & ' "' & @UserProfileDir & '\Music" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\OneDrive"' & ' "' & @UserProfileDir & '\OneDrive" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Pictures"' & ' "' & @UserProfileDir & '\Pictures" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Saved Games"' & ' "' & @UserProfileDir & '\Saved Games" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Searches"' & ' "' & @UserProfileDir & '\Searches" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Videos"' & ' "' & @UserProfileDir & '\Videos" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            RunWaitCW('robocopy "' & $var2 & "\" & @UserName & '\Favorites"' & ' "' & @UserProfileDir & '\Favorites" *.* /NDL /TEE /S /E /PURGE /DCOPY:DA /COPY:DAT /NP /XX /XO /XJ /R:2 /W:2  /log+:Restorelog.txt', "", @SW_SHOWNORMAL)
            MsgBox(0, "Job Status", "Restore Done ...", 2)
            ;FileDelete($file)


        Case $msg = $Button_4


        Case $msg = $Button_5
            Exit
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
            ;;;
    EndSelect
WEnd
Exit

; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()

OpenFile2()
Func OpenFile2()
    $Path = @DesktopDir & "\varma\Restorelog.txt"
    ;ShellExecute($Path)
EndFunc   ;==>OpenFile2

Func OpenFile1()
    $Path = @DesktopDir & "\varma\Backuplog.txt"
    ;ShellExecute($Path)
EndFunc   ;==>OpenFile1

Func RunWaitCW($txt, $a, $b)
    ConsoleWrite($txt & @CRLF)
EndFunc   ;==>RunWaitCW

It is basically only for debugging.

You have FileDelete($file) in this script, but there is nowhere a referrence to the $file.
The FileClose is meaningless in this case, too, because there is no file being opened.

Edited by Dan_555

Some of my script sourcecode

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...