Secure use of passwords in batch files?


Recommended Posts

  On 28/07/2010 at 23:33, Prt Scr said:

One thing for starters, youre missing a comma after the robocopy options:

1=/mir /dcopy:T /copy:DATO /xd,"D:\Patrick\Downloads" "D:\Patrick\Desktop" /xa:h,D:\Patrick,\\DOWNSTAIRS\Patrick$

Then theres the options that appear in the wrong place /xa:h

1=/mir /dcopy:T /copy:DATO /xd,"D:\Patrick\Downloads" "D:\Patrick\Desktop" /xa:h,D:\Patrick,\\DOWNSTAIRS\Patrick$

It should be:

1=/mir /dcopy:T /copy:DATO /xd /xa:h,"D:\Patrick\Downloads" "D:\Patrick\Desktop" ,D:\Patrick,\\DOWNSTAIRS\Patrick$

The next issue is why there are 3 sets of folders listed:

"D:\Patrick\Downloads" "D:\Patrick\Desktop" ,D:\Patrick,\\DOWNSTAIRS\Patrick$

As noted before, and in the top of the script, the ini file format i used was:

job number = robocopy optionscommasource foldercommadestination folder

No, those options are correct. This works on the command line:

robocopy.exe "D:\Patrick" \\DOWNSTAIRS\Patrick$ /mir /dcopy:T /copy:DATO /xd "D:\Patrick\Downloads" "D:\Patrick\Desktop" /xa:h

/xd means exclude directory. I don't want Downloads or Desktop copied.

  On 28/07/2010 at 23:46, unknownsoldierX said:

No, those options are correct. This works on the command line:

robocopy.exe "D:\Patrick" \\DOWNSTAIRS\Patrick$ /mir /dcopy:T /copy:DATO /xd/xa:h

/xd means exclude directory. I don't want Downloads or Desktop copied.

Then it needs to be:

1=/mir /dcopy:T /copy:DATO /xd "D:\Patrick\Downloads" "D:\Patrick\Desktop" /xa:h,D:\Patrick,\\DOWNSTAIRS\Patrick$

  On 29/07/2010 at 00:24, unknownsoldierX said:

Look back at my post. That's exactly what I have.

too many late nights....

Was thinking about this issue while i was on the train to my country hideout on thursday, and its my fault it isnt running, forgot you were backing up to a network location, the destination folder check is only checking and parsing errors for physical drives

sometimes im as thick as ****

what you see in the log is destination drive as ]

because my physical drive check first strips the letter of the drive (i.e. z:\ becomes z) to check to see if its the truecrypt drive which we know will fail a drivestatus request...when you shove a network path in there it goes from \\ to \, and fails when it requests the status of drive \

You can try the following code in the mean time , as a quick patch job, Ill fix it when get home in a couple of days, currently having to type this on a mac in country nsw and i hate macs....this has to be the worst keyboard in history, i swear it was made by the same company that makes tic tacs.....no useful keys like end or home or page up/down, cut&paste doesnt work as on a civilized pc...if it was mine id have heaved it out of the window by now, its taken 3 times as long to type this message on this hopeless apple crap...even the sinclair had a better keyboard than this

I actually threatened to stop talking to my family i they bought this thing...why oh why didnt i follow through....

Of course fixing the network path for the destination means now that ive woken up i will fix it for the source folder check as well

As i may have mentioned im not exactly as im my prime mentally as i was a few years ago when i was doing this gear in my sleep

replace this section

                ;get the pure letter of the drive to check against the truecrypt mounted drive letter for the current job
                ;if its the same, we already know it exists and we skip the next part of the drive check. If we dont check
                ;for a match here and the truyecrypt drive letter makes it into the next check it will FAIL as even though
                ;the truecrypt drive is mounted, it will report UNKNOWN to DriveStatus. This "error" is because TrueCrypt is a container, not a real drive.
                $CheckDestinationFolder = StringLeft($CopyDestination, 1)
                ;check destination drive exists - no point always testing if folder exists as the job may be creating a folder
                ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                If $CheckDestinationFolder <> $TC_DriveLetter Then
                        $CheckDestinationFolder2 = DriveStatus(StringLeft($CopyDestination, 3))
                        Select
                                Case "UNKNOWN"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "ERROR returned message - UKNOWN - Drive may be unformatted (RAW).")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "Drive may be unformatted (RAW).")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "READY"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                Case "INVALID"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder &" exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "UNKNOWN"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UKNOWN" & _
                                        @CRLF & "ERROR returned message - INVALID - Drive may be unformatted (RAW).")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UKNOWN" & _
                                        @CRLF & "ERROR returned message - INVALID - Drive may be unformatted (RAW).")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                        EndSelect

                Else
                        ;write truecrypt container as destination to console/logfile
                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                EndIf

with:

                ;check for network path as destination
                $CheckNetworkDrive = StringLeft($CopyDestination, 2)
                If $CheckNetworkDrive = "\\" Then
                Else
                ;get the pure letter of the drive to check against the truecrypt mounted drive letter for the current job
                ;if its the same, we already know it exists and we skip the next part of the drive check. If we dont check
                ;for a match here and the truyecrypt drive letter makes it into the next check it will FAIL as even though
                ;the truecrypt drive is mounted, it will report UNKNOWN to DriveStatus. This "error" is because TrueCrypt is a container, not a real drive.
                $CheckDestinationFolder = StringLeft($CopyDestination, 1)
                ;check destination drive exists - no point always testing if folder exists as the job may be creating a folder
                ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                If $CheckDestinationFolder <> $TC_DriveLetter Then
                        $CheckDestinationFolder2 = DriveStatus(StringLeft($CopyDestination, 3))
                        Select
                                Case "UNKNOWN"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "ERROR returned message - UKNOWN - Drive may be unformatted (RAW).")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "Drive may be unformatted (RAW).")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "READY"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                Case "INVALID"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder &" exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "UNKNOWN"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UKNOWN" & _
                                        @CRLF & "ERROR returned message - INVALID - Drive may be unformatted (RAW).")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UKNOWN" & _
                                        @CRLF & "ERROR returned message - INVALID - Drive may be unformatted (RAW).")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                        EndSelect

                Else
                        ;write truecrypt container as destination to console/logfile
                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                EndIf
                EndIf

User Credentials:  ACCEPTED
User Credentials:  Username and/or Password recognised on:  UPSTAIRS

Attempting to mount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Using command line:  "C:\Program Files\TeraCopy\TrueCrypt.exe" /q /v "\\DOWNSTAIRS\Locked$\backups" /lx /p password
Attempting to mount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....MOUNTED

Attempting to open job list file:  D:\Programs\backups\robocopy.ini ....
Attempting to open job list file:  D:\Programs\backups\robocopy.ini ....SUCCESSFUL

Processing jobs....

Job number:  1  starting...
Job number:  1  RoboCopy Options:  /mir /dcopy:T /copy:DATO /xa:h
Job number:  1  Source Folder:  "D:\Temp"
Job number:  1  Destination Folder:  "H:\Temp"
Job number:  1  Checking source folder:  "D:\Temp" exists....
Job number:  1  Checking source folder:  "D:\Temp" exists....SUCCESS
Job number:  1  Checking destination drive:  H exists and is accessible....
Job number:  1  Checking destination drive:  H exists and is accessible....FAILED: UNKNOWN
Drive may be unformatted (RAW).

1  total jobs submitted for  processing
0  of  1  jobs completed successfully

Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....FAILED
ExitCode:  0TrueCrypt returned error:  0
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....UNMOUNTED

  On 30/07/2010 at 21:06, unknownsoldierX said:

User Credentials:  ACCEPTED
User Credentials:  Username and/or Password recognised on:  UPSTAIRS

Attempting to mount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Using command line:  "C:\Program Files\TeraCopy\TrueCrypt.exe" /q /v "\\DOWNSTAIRS\Locked$\backups" /lx /p password
Attempting to mount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....MOUNTED

Attempting to open job list file:  D:\Programs\backups\robocopy.ini ....
Attempting to open job list file:  D:\Programs\backups\robocopy.ini ....SUCCESSFUL

Processing jobs....

Job number:  1  starting...
Job number:  1  RoboCopy Options:  /mir /dcopy:T /copy:DATO /xa:h
Job number:  1  Source Folder:  "D:\Temp"
Job number:  1  Destination Folder:  "H:\Temp"
Job number:  1  Checking source folder:  "D:\Temp" exists....
Job number:  1  Checking source folder:  "D:\Temp" exists....SUCCESS
Job number:  1  Checking destination drive:  H exists and is accessible....
Job number:  1  Checking destination drive:  H exists and is accessible....FAILED: UNKNOWN
Drive may be unformatted (RAW).

1  total jobs submitted for  processing
0  of  1  jobs completed successfully

Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....FAILED
ExitCode:  0TrueCrypt returned error:  0
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....UNMOUNTED

Back home again, on a windows machine

Okay, fair cop, i will always admit when ive made a mistake

In this case you got the above error because i used Select/EndSelect when i should have used Switch/EndSwitch in the drive status check

And i also doubled up: Case "UNKNOWN" instead of "NOTREADY" ...fixed

I can confirm that both hard drive and network destinations work with the corrections

I will add checking for a network source folder and then post the complete code later tonight

existing code

                ;check for network path as destination
                $CheckNetworkDrive = StringLeft($CopyDestination, 2)
                If $CheckNetworkDrive = "\\" Then
                Else
                ;get the pure letter of the drive to check against the truecrypt mounted drive letter for the current job
                ;if its the same, we already know it exists and we skip the next part of the drive check. If we dont check
                ;for a match here and the truyecrypt drive letter makes it into the next check it will FAIL as even though
                ;the truecrypt drive is mounted, it will report UNKNOWN to DriveStatus. This "error" is because TrueCrypt is a container, not a real drive.
                $CheckDestinationFolder = StringLeft($CopyDestination, 1)
                ;check destination drive exists - no point always testing if folder exists as the job may be creating a folder
                ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                If $CheckDestinationFolder <> $TC_DriveLetter Then
                        $CheckDestinationFolder2 = DriveStatus(StringLeft($CopyDestination, 3))
                        Select
                                Case "UNKNOWN"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "ERROR returned message - UKNOWN - Drive may be unformatted (RAW).")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "Drive may be unformatted (RAW).")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "READY"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                Case "INVALID"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder &" exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "UNKNOWN"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UKNOWN" & _
                                        @CRLF & "ERROR returned message - INVALID - Drive may be unformatted (RAW).")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UKNOWN" & _
                                        @CRLF & "ERROR returned message - INVALID - Drive may be unformatted (RAW).")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                        EndSelect

                Else
                        ;write truecrypt container as destination to console/logfile
                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                EndIf
                EndIf

corrected:

                ;check for network path as destination
                $CheckNetworkDrive = StringLeft($CopyDestination, 2)
                If $CheckNetworkDrive = "\\" Then
                Else
                ;get the pure letter of the drive to check against the truecrypt mounted drive letter for the current job
                ;if its the same, we already know it exists and we skip the next part of the drive check. If we dont check
                ;for a match here and the truyecrypt drive letter makes it into the next check it will FAIL as even though
                ;the truecrypt drive is mounted, it will report UNKNOWN to DriveStatus. This "error" is because TrueCrypt is a container, not a real drive.
                $CheckDestinationFolder = StringLeft($CopyDestination, 1)
                ;check destination drive exists - no point always testing if folder exists as the job may be creating a folder
                ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....")
                If $CheckDestinationFolder <> $TC_DriveLetter Then
                        $CheckDestinationFolder2 = DriveStatus(StringLeft($CopyDestination, 3))
                        Switch $CheckDestinationFolder2
                                Case "UNKNOWN"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "ERROR returned message - UKNOWN - Drive may be unformatted (RAW).")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: UNKNOWN" & _
                                        @CRLF & "Drive may be unformatted (RAW).")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "READY"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY")
                                Case "NOTREADY"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: NOTREADY" & _
                                        @CRLF & "ERROR returned message - NOTREADY - Typical of floppy and CD drives that do not contain media.")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: NOTREADY" & _
                                        @CRLF & "ERROR returned message - NOTREADY - Typical of floppy and CD drives that do not contain media.")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop
                                Case "INVALID"
                                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder &" exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....FAILED: INVALID" & _
                                        @CRLF & "ERROR returned message - INVALID - May indicate the drive letter does not exist or that a mapped network drive is inaccessible.")
                                        ;decrease the amount of successful jobs by 1
                                        $NumberOfJobs -= 1
                                        ;skip to next job
                                        ContinueLoop

                        EndSwitch

                Else
                        ;write truecrypt container as destination to console/logfile
                        ConsoleWrite(@CRLF & "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                        FileWriteLine($Log, "Job number:  " & $i &  "  Checking destination drive:  " & $CheckDestinationFolder & " exists and is accessible....SUCCESS: DRIVE READY (Using TrueCrypt Container)")
                EndIf
                EndIf

User Credentials:  ACCEPTED
User Credentials:  Username and/or Password recognised on:  UPSTAIRS

Attempting to mount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Using command line:  "C:\Program Files\TeraCopy\TrueCrypt.exe" /q /v "\\DOWNSTAIRS\Locked$\backups" /lx /p password
Attempting to mount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....MOUNTED

Attempting to open job list file:  D:\Programs\backups\robocopy.ini ....
Attempting to open job list file:  D:\Programs\backups\robocopy.ini ....SUCCESSFUL

Processing jobs....

Job number:  1  starting...
Job number:  1  RoboCopy Options:  /mir /dcopy:T /copy:DATO /xa:h
Job number:  1  Source Folder:  "D:\Temp"
Job number:  1  Destination Folder:  "H:\Temp"
Job number:  1  Checking source folder:  "D:\Temp" exists....
Job number:  1  Checking source folder:  "D:\Temp" exists....SUCCESS
Job number:  1  Checking destination drive:  H exists and is accessible....
Job number:  1  Checking destination drive:  H exists and is accessible....SUCCESS: DRIVE READY
Job number:  1  ROBOCOPY reports:  NO CHANGE **** PARTIAL SUCCESS **** - CHECK ROBOCOPY LOG OR FURTHER INFO

1  total jobs submitted for  processing
1  of  1  jobs completed successfully

Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....FAILED
ExitCode:  0TrueCrypt returned error:  0
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....UNMOUNTED

Okay, script updated

Added:

* Checking for network paths as source/destination

* Domain/ComputerName extracted from path, Domain/ComputerName is then pinged to make sure it exists, is it passes then the share name is tested, if that passes, the copy job continues, otherwise as with other failures, it skips to the next job

Changed:

* Some of the text and labels, for example SUCCESS is replaced by OK

* Generally shortened long output strings as much as i thought i could and remain informative.

I thought id attach the script this time instead of bloating the thread any further. Just need to rename the extension from .txt to .au3 (the forum doesnt allow uploading of .au3)

tcrobocopy.txtFetching info...

As for your unmounting error, all i can say is that iuve looked into it from several angles and the only reason it can fail unmounting is if you have files to the truecrypt volume open. Dont have any programs trying to or actually accessing the volume. Make sure you dont have say explorer browsing that folder while the script is running...tat is as i may have said before, ids THE ONLY way i can get it to fail.

I don't get permission errors for robocopy anymore, so that is working better. But the drive still doesn't mount. It says it's mounted but it never actually mounts.

I think I found the problem. Notice this in the copy log:

Using command line:  "C:\Program Files\TeraCopy\TrueCrypt.exe" /q /v "\\DOWNSTAIRS\Locked$\backups" [b]/lx[/b] /p password

There should be a space between the /l and the x. I'm not sure how to fix it.

Copylog

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Programs\Backups\backups.au3"    

User Credentials:  ACCEPTED
User Credentials:  Username and/or Password recognised on:  UPSTAIRS

Mounting truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ...
Using command line:  "C:\Program Files\TeraCopy\TrueCrypt.exe" /q /v "\\DOWNSTAIRS\Locked$\backups" /lx /p password
Mounting truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ...MOUNTED

Open job list file:  D:\Programs\backups\Robocopy.ini ...
Open job list file:  D:\Programs\backups\Robocopy.ini ...OK

Processing jobs...

Job number:  1  starting...
Job number:  1  RoboCopy Options:  /mir /dcopy:T /copy:DT /xa:h
Job number:  1  Source Folder:  "D:\Temp"
Job number:  1  Destination Folder:  "H:\Temp"
Job number:  1  Source:  D:\Temp exists...
Job number:  1  Source:  D:\Temp exists...OK
Job number:  1  Destination:  H:\Temp exists...
Job number:  1  Destination:  H exists and is accessible....
Job number:  1  Destination:  H exists...OK: DRIVE READY
Job number:  1  ROBOCOPY reports:  NO CHANGE **** PARTIAL SUCCESS **** - CHECK ROBOCOPY LOG OR FURTHER INFO

1  total jobs submitted for  processing
1  of  1  jobs completed successfully

Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ...FAIL
ExitCode:  0TrueCrypt returned error:  0
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....UNMOUNTED>Exit code: 0    Time: 2.814

Job_1_robocopy.log

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Fri Aug 06 12:03:59 2010

   Source : D:\Temp\
     Dest : H:\Temp\

    Files : *.*

  Options : *.* /S /E /COPY:DT /DCOPY:T /PURGE /MIR /XA:H /R:1000000 /W:30 

------------------------------------------------------------------------------

	                   0	D:\Temp\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

   Ended : Fri Aug 06 12:03:59 2010

  On 06/08/2010 at 17:09, unknownsoldierX said:

I don't get permission errors for robocopy anymore, so that is working better. But the drive still doesn't mount. It says it's mounted but it never actually mounts.

I think I found the problem. Notice this in the copy log:

Using command line:  "C:\Program Files\TeraCopy\TrueCrypt.exe" /q /v "\\DOWNSTAIRS\Locked$\backups" [b]/lx[/b] /p password

There should be a space between the /l and the x. I'm not sure how to fix it.

Copylog

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Programs\Backups\backups.au3"    

User Credentials:  ACCEPTED
User Credentials:  Username and/or Password recognised on:  UPSTAIRS

Mounting truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ...
Using command line:  "C:\Program Files\TeraCopy\TrueCrypt.exe" /q /v "\\DOWNSTAIRS\Locked$\backups" /lx /p password
Mounting truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ...MOUNTED

Open job list file:  D:\Programs\backups\Robocopy.ini ...
Open job list file:  D:\Programs\backups\Robocopy.ini ...OK

Processing jobs...

Job number:  1  starting...
Job number:  1  RoboCopy Options:  /mir /dcopy:T /copy:DT /xa:h
Job number:  1  Source Folder:  "D:\Temp"
Job number:  1  Destination Folder:  "H:\Temp"
Job number:  1  Source:  D:\Temp exists...
Job number:  1  Source:  D:\Temp exists...OK
Job number:  1  Destination:  H:\Temp exists...
Job number:  1  Destination:  H exists and is accessible....
Job number:  1  Destination:  H exists...OK: DRIVE READY
Job number:  1  ROBOCOPY reports:  NO CHANGE **** PARTIAL SUCCESS **** - CHECK ROBOCOPY LOG OR FURTHER INFO

1  total jobs submitted for  processing
1  of  1  jobs completed successfully

Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ...FAIL
ExitCode:  0TrueCrypt returned error:  0
Attempting to unmount truecrypt volume:  "\\DOWNSTAIRS\Locked$\backups"  on drive letter:  x ....UNMOUNTED>Exit code: 0    Time: 2.814

Job_1_robocopy.log

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Fri Aug 06 12:03:59 2010

   Source : D:\Temp\
     Dest : H:\Temp\

    Files : *.*

  Options : *.* /S /E /COPY:DT /DCOPY:T /PURGE /MIR /XA:H /R:1000000 /W:30 

------------------------------------------------------------------------------

	                   0	D:\Temp\

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00

   Ended : Fri Aug 06 12:03:59 2010

I hate to tell you, but theres no difference whether you put a space in there or not.

Ive made some more changes and will post it after i test, after i get some sleep, its almost 5am here....

It makes a difference when I do it at the command line.

"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v \\DOWNSTAIRS\Locked$\backups /l X /p password /s /q

Works.

"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v \\DOWNSTAIRS\Locked$\backups /lX /p password /s /q

Does not work. No errors, but the volume doesn't mount.

  On 06/08/2010 at 19:18, unknownsoldierX said:

It makes a difference when I do it at the command line.

"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v \\DOWNSTAIRS\Locked$\backups /l X /p password /s /q

Works.

"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v \\DOWNSTAIRS\Locked$\backups /lX /p password /s /q

Does not work. No errors, but the volume doesn't mount.

Then you must have the only system in the world that does that because, quoting from the truecrypt documentation for mounting and unmounting (examples):

Dismount a volume mounted as the drive letter X (the main program window will not be displayed):

truecrypt /q /dx


Mount a volume called myvolume.tc using the password MyPassword, as the drive letter X. TrueCrypt will open an explorer window and beep; mounting will be automatic:

truecrypt /v myvolume.tc /lx /a /p MyPassword /e /b

Ill put the space in, but seriously, theres something weird in that i and the rest of the planet can use it without a space.

Okay

Added:

* Added/Left space after tc drive letter in command line for both mounting and unmounting

* Check that tc volume is still mounted BEFORE trying to unmount it (seemed a sane thing to do:) ) should clear up the errors you were getting when tc volume wasnt mounted in the first place

* A few other changes in the handling of errors when trying to copy to a tc volume that doesnt exist because it wasnt mounted!

tcrobocopy.txtFetching info...

Okay

Fixed:

* incorrect order of robocopy options (i finally read a manual)

Added:

* summary counters for excluded jobs (jobs in the ini file with a # in front of the number) and jobs with errors

* date time stamping of log file(s)

2 versions:

v1 - Outputs separate log files for the main script output and each job

tcrobocopy_seperate_logs..txtFetching info...

v2 (at request of OP) - Outputs all script and robocopy output to the one log file

tcrobocopy_all_in_one_log..txtFetching info...

  • 4 months later...

I was trying to find a solution for this problem, converting .bat files to .exe will not ever solve the problem because any intermediate programmer can get the password easily so I?ve created a new command line tool that can help many others like us to encrypt the .bat file using X509 certificate.

You can find my tool under: http://securebatch.codeplex.com/

Enjoy it!

-Firas

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • What is happening in the WNBA!    
    • RapidRAW 1.3.5 is out.
    • Microsoft Edge 139.0.3405.86 by Razvan Serea Microsoft Edge is a super fast and secure web browser from Microsoft. It works on almost any device, including PCs, iPhones and Androids. It keeps you safe online, protects your privacy, and lets you browse the web quickly. You can even use it on all your devices and keep your browsing history and favorites synced up. Built on the same technology as Chrome, Microsoft Edge has additional built-in features like Startup boost and Sleeping tabs, which boost your browsing experience with world class performance and speed that are optimized to work best with Windows. Microsoft Edge security and privacy features such as Microsoft Defender SmartScreen, Password Monitor, InPrivate search, and Kids Mode help keep you and your loved ones protected and secure online. Microsoft Edge has features to keep both you and your family protected. Enable content filters and access activity reports with your Microsoft Family Safety account and experience a kid-friendly web with Kids Mode. The new Microsoft Edge is now compatible with your favorite extensions, so it’s easy to personalize your browsing experience. Microsoft Edge 139.0.3405.86 changelog: Fixes Fixed an issue where MIP-protected PDF files from different sovereign cloud environments (including GCCH) failed to open and instead displayed the error message: “Need permissions. Contact the owner of the file to give you permissions.” Fixed an issue, which affected IE mode, including errors when displaying PDF files, running Java applets, and showing the Information Bar in IE mode. Improved reliability Fixed a browser crash that occurred on first launch when the BrowserSignin policy was enabled and configured to "Force (2) = Force users to sign-in to use the browser (all profiles)." Feature updates Open external links in another profile when recommended by external applications. When Microsoft Edge is set as the default browser to open external links from applications, Microsoft Edge must determine which profile to open the links. Users can control which profile to use through the “Default profile for external links” setting. Applications such as Microsoft Teams or Outlook can also recommend a profile for the links. Currently, the user setting is prioritized over application recommendations. With this feature, the application recommended profile is given priority, instead of the profile selected in the setting. Admins can control the availability of the feature using the EdgeOpenExternalLinksWithAppSpecifiedProfile policy. Note: This is a controlled feature rollout. If you don't see this feature, check back as we continue our rollout. Changes to Wallet in Microsoft Edge. Wallet is being phased out to support a streamlined experience within Microsoft Edge. This affects the Wallet feature in Settings and the Mini Wallet found by clicking the profile icon in the top banner. Users are directed to the new Passwords, Payment, and Personal Information management experience in Settings. Also, a new Password management experience is available in Settings. For more information, see Changes to Wallet in Microsoft Edge. Note: This is a controlled feature rollout. If you don't see this feature, check back as we continue our rollout. Introducing a new policy that can enable/disable Microsoft 365 Copilot Chat in Edge for Business from showing in the toolbar. Edge for Business now has a dedicated policy, Microsoft365CopilotChatIconEnabled, to enable and disable Copilot in Edge from showing in the Edge toolbar. When both this policy and HubsSidebarEnabled are configured, this policy takes precedence in determining whether Copilot appears in the toolbar. If this policy isn't configured and HubsSidebarEnabled is disabled, Copilot will remain hidden. In a future release, this policy is the sole control for managing Copilot's visibility in the toolbar. Real-time notifications for compromised passwords. Microsoft Edge is integrating an in-context password breach notification system. This feature proactively informs users if their saved login credentials have been compromised in known data breaches, enabling them to take immediate action to secure their accounts. Admins can control availability to this feature using the PasswordMonitorAllowed policy. Note: This is a controlled feature rollout. If you don't see this feature, check back as we continue our rollout. Edge Settings Improvements. Edge Settings is migrating to WebUI2 to boost page responsiveness and introducing a series of minor visual and content upgrades to improve overall usability and utility. This includes optimizing for concise wording of individual settings, simplifying the number of pages and reorganizing content, and creating a cohesive user interface. New Autofill Personal Information Settings Configuration. A web form field collection consent toggle will be available in Autofill settings (edge://settings/autofill/personalInfo). This allows users to consent to Microsoft Edge collecting web form field labels (e.g., "First Name," "Email") to improve Autofill suggestion accuracy. Only field labels are collected and not user-entered data. The web field labels are stored securely per Microsoft's privacy standards. This new setting is manageable via existing policies in Autofill (e.g., AutofillAddressEnabled), EdgeAutofillMlEnabled. AutofillAddressEnabledis the parent setting forEdgeAutofillMlEnabled. The EdgeAutofillMlEnabled policy is the parent of this new setting, thus turning off the EdgeAutofillMlEnabled policy turns off this setting. Web AI APIs for prompt and writing assistance. Microsoft Edge now implements the Writing Assistance APIs and the Prompt API (for Edge extensions) with a local language model, Phi-4-mini, that is built into the browser. These easy-to-use JavaScript APIs are made available via Edge flags (set to Enabled, by default only for the Summarizer and Prompt API for extensions) so that sites and extensions can apply AI capabilities on the web. The small language model is downloaded as the first time any of these APIs is used and later shared across all domains, serving local AI use-cases with reduced cost, network independence, and increased privacy (since data input to the model doesn't leave the user’s device). Admins can control the availability of these APIs via the GenAILocalFoundationalModelSettings policy. These APIs are currently not implemented in China. Read the announcement here, and feel free to provide feedback. Enhancements to Performance and Secure network. Browser essentials is now separated into two distinct experiences (Performance and Secure Network) - both available from the Settings and more menu (“…” on the menu bar). Reset Microsoft Edge enterprise sync. For users having problems syncing browsing data across other signed-in devices, they can reset sync data from the Microsoft servers via Edge Settings edge://settings/profiles/sync/reset. This option should only be used if the sync data is available on one of the user's devices or if they want to delete all sync data from the servers. Note: In Microsoft Edge 139, reset sync is enabled for users encountering a "No permissions" MIP error and in Microsoft Edge 140, reset sync is enabled for users encountering a "Service disabled" MIP error. Update to Microsoft AutoUpdate policy. The MAUEnabled policy allowed admins to continue using Microsoft AutoUpdate on macOS. Since Microsoft Edge now uses EdgeUpdate, the MAUEnabled policy is planned to be obsoleted in Microsoft Edge version 140. Policy updates / New policies EdgeOpenExternalLinksWithAppSpecifiedProfile - Prioritize App specified profile to open external links EnableUnsafeSwiftShader - Allow software WebGL fallback using SwiftShader MandatoryExtensionsForInPrivateNavigation - Specify extensions users must allow in order to navigate using InPrivate mode Microsoft365CopilotChatIconEnabled - Control whether Microsoft 365 Copilot Chat shows in the Microsoft Edge for Business toolbar OnSecurityEventEnterpriseConnector - Configuration policy for Microsoft Edge for Business Reporting Connectors Obsoleted policies KeyboardFocusableScrollersEnabled - Enable keyboard focusable scrollers (obsolete) SelectParserRelaxationEnabled - Controls whether the new HTML parser behavior for the SELECT element is enabled (obsolete) Download: Microsoft Edge (64-bit) | 180.0 MB (Freeware) Download: Microsoft Edge (32-bit) | 163.0 MB View: Microsoft Edge Website | Release History Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      harveycoleman123 earned a badge
      Week One Done
    • First Post
      EzraNougat earned a badge
      First Post
    • One Month Later
      westDvina earned a badge
      One Month Later
    • Community Regular
      Bern@rd went up a rank
      Community Regular
    • Week One Done
      Joey Solo earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      663
    2. 2
      +FloatingFatMan
      192
    3. 3
      ATLien_0
      154
    4. 4
      Xenon
      132
    5. 5
      wakjak
      98
  • Tell a friend

    Love Neowin? Tell a friend!