Secure use of passwords in batch files?


Recommended Posts

I have a series of batch files that run a robocopy backup to a TrueCrypt container on a remote machine.

1. backups.bat on local machine uses psexec to start backup_share.bat on the remote machine.

2. backup_share.bat mounts the TrueCrypt container and shares folders inside.

3. backups.bat runs robocopy.

4. backups.bat uses psexec to run backups_unmount.bat

5. backups_unmount.bat unmounts the TrueCrypt volume.

All of this requires my username and passwords in the batch files. Is there a more secure way to do this?

backups.bat

@echo off

D:\Programs\PsTools\psexec.exe -h \\DOWNSTAIRS -u username -p password D:\Locked\backups_share.bat

rem Run robocopy...
"D:\Programs\backups (robo).bat"

D:\Programs\PsTools\psexec.exe -h \\DOWNSTAIRS -u username -p password D:\Locked\backups_unmount.bat

PAUSE

backups_share.bat

@echo off

rem Mount True Crypt Volume
D:\TrueCrypt\TrueCrypt.exe /v D:\Locked\backups /l G /p password /q

rem Share folders
Net share share1$=G:\share1 /grant:username,FULL
Net share share2$=G:\share2 /grant:username,FULL

backups_unmount.bat

@echo off

rem Unmount Truecrypt volume
D:\TrueCrypt\TrueCrypt.exe /d /q

I found some info about encrypting passwords with PowerShell.

http://www.vistax64.com/powershell/104344-how-encrypt-paswd-file-used-batch.html

http://powershell.com/cs/media/p/248.aspx

PowerShell looks way more complicated than what I'm doing. I'm not sure how to begin.

  On 22/07/2010 at 05:30, Raa said:

There's always a chance someone will decode your complied exe, or sniff it out in memory.

They did this at work with VBS files and passwords inside, and people got the contents from extracting the exe's and using memory viewers.

I forgot to specify that you'd use encryption. Although I think by trying to have all this handled automatically he's biting off more than he can chew.

I just tested this program. The batch file doesn't appear to be visible in plain text, so your password should be "hidden".

  Quote
http://www.battoexeconverter.com/

Encrypts batch file source to keep your code secret.

Users of your scripts cannot view/change your code after it is encrypted by the compiler. Any actions performed by the script can be kept secret.

If you want to take it a step further, this is a free EXE obfuscator which will make it more difficult to disassemble, although not impossible.

http://www.funradar.com/

  On 22/07/2010 at 06:26, unknownsoldierX said:

I assume I need to change the lines in my batch files. Change .bat's to .exe's. Do I have to change anything else?

If you like ill work you up a basic autoit script, its format is similar to most scripting languages, easy to figure out

Let me know

  On 22/07/2010 at 07:27, unknownsoldierX said:

I don't see any mention of security or encryption on the Autoit site.

Yeah well they spend more time developing it than they do on the web page :)

If you download AutoIT v3 and SciTE Editor also available on the AutoIT site, if you then compile a script with SciTe (Tools->Compile), you'll find the encryption stuff on the Obfuscate Tab....

post-282382-12797899386553.jpg

For example, heres a bare bones script ive hacked up in about 10 minutes (havent used AutoIT for a while), still adding error checking for the drive mapping, but ive tested the truecrypt mounting/unmounting

Also have no idea what your robocopy command line would be so thats blank, just a matter of the right RunAsWait line there...and error checking

Talking of error checking, TrueCrypt has pathetic exit code support, so it either fails on the command line or if you say try and mount an already mounted drive, you get a message box warning you of this, not a console exit code, so error checking is limited for TrueCrypt

Currently it runs at the command line and outputs errors or information to the console (command line), it can always pop up message boxes etc if you need. Ill post a finished version after i eat some dinner

If you go Tools->Compile on the first tab theres an option Create CUI instead of GUI.EXE, ticking this makes a console .exe, which is what i assumed you were looking for

Note: The opening section contains the compilation options (obfuscation etc already

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=1 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Partial quick script:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=1 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****


;====TrueCrypt Settings =========
;$TC_Exe - path to truecrypt executable
$TC_Exe = "D:\TrueCrypt\TrueCrypt.exe"
;truecrypt container path
$TC_Path = "i:\test"
; truecrypt driveletter assign
$TC_DriveLetter = "x"
;truecrypt password
$TC_Password =  "test123"



;====Netowork Share Settings =========
;MapDriveMachineName - name of machine that has drive you wish to map, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$MapDriveMachineName = "computername"
;MapDrivePath1 - the 1st path on the machine you wish to share
$MapDrivePath1 = "\path"
;MapDrivePath2 - the 2nd path on the machine you wish to share
$MapDrivePath2 = "\path"
;NetworkDomain - name of domain that contains your user credentials, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$NetworkDomain = "domain"
;NetworkUsername - your network username
$NetworkUsername = "username"
;NetworkPassword - your network password
$NetworkPassword = "password"




;Mount True Crypt Volume
$TCMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /v " & $TC_Path & " /l" & $TC_DriveLetter & " /p " & $TC_Password)

If NOT @error Or $TCMount = 0 Then

	;write the success of truecrypt monting to the console
	ConsoleWrite(@CRLF & "Successfully mounted: "& $TC_Path & " to Drive: " & $TC_DriveLetter)

	; Map drives
	$Map1_Add = DriveMapAdd("y:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath1, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	$Map2_Add = DriveMapAdd("z:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath2, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)

	; Robocopy stuff


        ;UnMap Drives
	$Map1_Del = DriveMapDel("y:")
	$Map2_Del = DriveMapAdd("z:")

	;Un-Mount True Crypt Volume
	$TCUnMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /d " & $TC_DriveLetter)
	If @error Or $TCUnMount > 0 Then
		ConsoleWrite(@CRLF & ""Failed to unmount: "& $TC_Path & " from Drive " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCUnMount)
	EndIf
	ConsoleWrite(@CRLF & "Successfully unmounted: "& $TC_Path & " from Drive: " & $TC_DriveLetter)
	Exit

Else
	;write the failure of truecrypt mounting to the console
	ConsoleWrite("Failed to mount: "& $TC_Path & " to Drive: " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCMount)
EndIf

This is the more complete version, as opposed to your 3 files method, this is all in one

Cleaned up some typos in the original post

Probably needs some testing and tweaking, but i dont have a network here to test one....

Like i said, its quick and dirty and the network mapping isnt tested on my end

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=1 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

; variables

;====TrueCrypt Settings =========
;$TC_Exe - path to truecrypt executable
$TC_Exe = "D:\TrueCrypt\TrueCrypt.exe"
;truecrypt container path
$TC_Path = "i:\test"
; truecrypt driveletter assign
$TC_DriveLetter = "x"
;truecrypt password
$TC_Password =  "test123"

;====Netowork Share Settings =========
;MapDriveMachineName - name of machine that has drive you wish to map, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$MapDriveMachineName = "computername"
;MapDrivePath1 - the 1st path on the machine you wish to share
$MapDrivePath1 = "\path"
;MapDrivePath2 - the 2nd path on the machine you wish to share
$MapDrivePath2 = "\path"
;NetworkDomain - name of domain that contains your user credentials, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$NetworkDomain = "domain"
;NetworkUsername - your network username
$NetworkUsername = "username"
;NetworkPassword - your network password
$NetworkPassword = "password"

;====Robocopy Settings =========
;$RC_Path - path to robocopy
$RC_Path = "D:\Robocopy\robocopy.exe"
;$RC_Options - robocopy options
$RC_Options = "/e /copyall"
;$RC_Source - source path
$RC_Source = "D:\source"
;$RC_Destination - source path
$RC_Destination = "D:\destination"



; script start

;Mount True Crypt Volume
$TCMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /v " & $TC_Path & " /l" & $TC_DriveLetter & " /p " & $TC_Password)

If NOT @error Or $TCMount == 0 Then

	;write the success of truecrypt monting to the console
	ConsoleWrite(@CRLF & "Successfully mounted: "& $TC_Path & " to Drive: " & $TC_DriveLetter)

	; Map drives
	$Map1_Add = DriveMapAdd("y:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath1, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map1_Add == 1 Then
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath1  & " the error returned is: " & @extended)
		Exit
	EndIf
	$Map2_Add = DriveMapAdd("z:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath2, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map2_Add == 1 Then
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath2  & " the error returned is: " & @extended)
		Exit
	EndIf

	;Robocopy stuff
	$TCUnMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, $RC_Path & " " & $RC_Options & " " & $RC_Source & " " &$RC_Destination)
	If @error Then
		ConsoleWrite("Robocopy failed, the error returned is: " & @error)
		Exit
        Else
	EndIf

	;whack in a quick 2 second sleep
	Sleep(2000)

        ;UnMap Drives
	$Map1_Del = DriveMapDel("y:")
	$Map2_Del = DriveMapDel("z:")

	;Un-Mount True Crypt Volume
	$TCUnMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /d " & $TC_DriveLetter)
	If @error Or $TCUnMount > 0 Then
		ConsoleWrite(@CRLF & "Failed to unmount: "& $TC_Path & " from Drive " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCUnMount)
	EndIf
	ConsoleWrite(@CRLF & "Successfully unmounted: "& $TC_Path & " from Drive: " & $TC_DriveLetter)
	Exit

Else
	;write the failure of truecrypt mounting to the console
	ConsoleWrite("Failed to mount: "& $TC_Path & " to Drive: " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCMount)
EndIf

Due to the fact i cant edit the above posts, heres an even more complete version with robocopy error checking enabled

Apparently there are different thoughts on what exactly the exit codes for robocopy are, ive used what MS says...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=1 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

; variables

;====TrueCrypt Settings =========
;$TC_Exe - path to truecrypt executable
$TC_Exe = "D:\TrueCrypt\TrueCrypt.exe"
;truecrypt container path
$TC_Path = "i:\test"
; truecrypt driveletter assign
$TC_DriveLetter = "x"
;truecrypt password
$TC_Password =  "test123"

;====Netowork Share Settings =========
;MapDriveMachineName - name of machine that has drive you wish to map, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$MapDriveMachineName = "computername"
;MapDrivePath1 - the 1st path on the machine you wish to share
$MapDrivePath1 = "\path"
;MapDrivePath2 - the 2nd path on the machine you wish to share
$MapDrivePath2 = "\path"
;NetworkDomain - name of domain that contains your user credentials, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$NetworkDomain = "domain"
;NetworkUsername - your network username
$NetworkUsername = "username"
;NetworkPassword - your network password
$NetworkPassword = "password"

;====Robocopy Settings =========
;$RC_Path - path to robocopy
$RC_Path = "D:\Robocopy\robocopy.exe"
;$RC_Options - robocopy options
$RC_Options = "/e /copyall"
;$RC_Source - source path
$RC_Source = "D:\source"
;$RC_Destination - source path
$RC_Destination = "D:\destination"



; script start

;Mount True Crypt Volume
$TCMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /v " & $TC_Path & " /l" & $TC_DriveLetter & " /p " & $TC_Password)

If NOT @error Or $TCMount == 0 Then

	;write the success of truecrypt monting to the console
	ConsoleWrite(@CRLF & "Successfully mounted: "& $TC_Path & " to Drive: " & $TC_DriveLetter)

	; Map drives
	$Map1_Add = DriveMapAdd("y:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath1, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map1_Add == 1 Then
		ConsoleWrite("Successfully mapped network drive: " & $MapDrivePath1)
		SetError(0)
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath1  & " the error returned is: " & @extended)
		Exit
	EndIf

	$Map2_Add = DriveMapAdd("z:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath2, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map2_Add == 1 Then
		ConsoleWrite("Successfully mapped network drive: " & $MapDrivePath2)
		SetError(0)
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath2  & " the error returned is: " & @extended)
		Exit
	EndIf

	;Robocopy stuff
	$TCUnMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, $RC_Path & " " & $RC_Options & " " & $RC_Source & " " &$RC_Destination)
	;Write copy result to console
	Switch @error
		Case 0	
			ConsoleWrite("No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.")
		Case 1	
			ConsoleWrite("All files were copied successfully.")
		Case 2	
			ConsoleWrite("There are some additional files in the destination directory that are not present in the source directory. No files were copied.")
		Case 3	
			ConsoleWrite("Some files were copied. Additional files were present. No failure was encountered.")
		Case 5	
			ConsoleWrite("Some files were copied. Some files were mismatched. No failure was encountered.")
		Case 6	
			ConsoleWrite("Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory.")
		Case 7	
			ConsoleWrite("Files were copied, a file mismatch was present, and additional files were present.")
	EndSwitch		


	;According to MS any error code greater than 8 means a robocopy failure
	If @error >= 8 Then
		ConsoleWrite("Robocopy failed, the error returned is: " & @error)
		Exit
        Else
	EndIf

	;whack in a quick 2 second sleep
	Sleep(2000)

        ;UnMap Drives
	$Map1_Del = DriveMapDel("y:")
	$Map2_Del = DriveMapDel("z:")

	;Un-Mount True Crypt Volume
	$TCUnMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /d " & $TC_DriveLetter)
	If @error Or $TCUnMount > 0 Then
		ConsoleWrite(@CRLF & "Failed to unmount: "& $TC_Path & " from Drive " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCUnMount)
	EndIf
	ConsoleWrite(@CRLF & "Successfully unmounted: "& $TC_Path & " from Drive: " & $TC_DriveLetter)
	Exit

Else
	;write the failure of truecrypt mounting to the console
	ConsoleWrite("Failed to mount: "& $TC_Path & " to Drive: " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCMount)
EndIf

Thanks. I don't understand all of that, but it should be a great learning experience and get me started with autoit.

I don't get the robocopy settings section. It seems like there is just one set of source and destination variables. Also, how would I go about adding more robocopy jobs?

Currently, in my robocopy.bat, I have lines like this:

C:\windows\system32\robocopy.exe "G:\Folder1" \\DOWNSTAIRS\Folder1$ /mir /zb /dcopy:T /copyall /xa:h > "D:\Locked\backups_log.txt"

I use the same options for each job. And I have each one append the log file.

And just to clarify, I'm not on a domain, so I put the name of my local machine for the $NetworkDomain, correct?

  On 22/07/2010 at 11:33, unknownsoldierX said:

Thanks. I don't understand all of that, but it should be a great learning experience and get me started with autoit.

I don't get the robocopy settings section. It seems like there is just one set of source and destination variables. Also, how would I go about adding more robocopy jobs?

Currently, in my robocopy.bat, I have lines like this:

C:\windows\system32\robocopy.exe "G:\Folder1" \\DOWNSTAIRS\Folder1$ /mir /zb /dcopy:T /copyall /xa:h > "D:\Locked\backups_log.txt"

I use the same options for each job. And I have each one append the log file.

And just to clarify, I'm not on a domain, so I put the name of my local machine for the $NetworkDomain, correct?

If youre not on a domain, under AutoIT you can use @ComputerName instead of "domain" just remember to not enclose it in " "

Okay the quickest and most painless way to run multiple copies, as you say you have the same copy options for each job, would be to use an .ini file

Ini files, you may have seen, have a section heading, and then key abd value pairs

i.e.

[section heading]
key=value

So you could just use an .ini file i.e. robocopy.ini, use a section heading [copy] store the source as the key and the destination as the value

Then you just loop through the key/value pairs using the autoit command IniReadSection and apply those key(source) and value(destination) pairs which come out as a 2 dimensional array to the robocopy command line

This is how it is done in my example script:

New variable declared in robocopy section, this just sets the path to the ini file

$RC_Ini = "D:\TrueCrypt\Robocopy.ini"

Next we loop through the key/value pairs and send them through the previous robocopy routine i posted earlier, with modifications

	;Robocopy stuff
	$CopyLines = IniReadSection($RC_Ini, "Copy")
	If @error Then
		MsgBox(4096, "", "Error occurred, probably no INI file.")
	Else
		For $i = 1 To $CopyLines[0][0]
		$RoboCopy = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, $RC_Path & " " & $RC_Options & " " & $CopyLines[$i][0] & " " & $CopyLines[$i][1])
		;Write copy result to console
		Switch @error
			Case 0
				ConsoleWrite("No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.")
			Case 1
				ConsoleWrite("All files were copied successfully.")
			Case 2
				ConsoleWrite("There are some additional files in the destination directory that are not present in the source directory. No files were copied.")
			Case 3
				ConsoleWrite("Some files were copied. Additional files were present. No failure was encountered.")
			Case 5
				ConsoleWrite("Some files were copied. Some files were mismatched. No failure was encountered.")
			Case 6
				ConsoleWrite("Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory.")
			Case 7
				ConsoleWrite("Files were copied, a file mismatch was present, and additional files were present.")
		EndSwitch
		;According to MS any error code greater than 8 means a robocopy failure
		If @error >= 8 Then
			ConsoleWrite("Robocopy failed, the error returned is: " & @error)
		Exit
		Else
		EndIf
		Next
	EndIf

The loop part:

For $i = 1 To $CopyLines[0][0]

$CopyLines as mentioned is a 2 dimensional array thats what the [0] [0] part is, in autoit array element 0, or [0] always the maximum number of array elements.

So if we have 4 key value pairs, the true value of $CopyFiles is [4][4]

And For $i = 1 To $CopyLines[0][0] will run 4 times, with $I increasing by 1 each time until it hits 4 and the robocopy command will execute using each new key/value pair...$CopyLines[$i][0] is the key, $CopyLines[$i][1] is the value

To help you understand the loop better,

Create a file named robocopy.ini and paste the following in it:

[Copy]
c:\temp=d:\temp
c:\windows=e:\windows
d:\programs=f:\programs
f:\test=g:\test2

Then you can run the following script snippet (changing the path to the ini file you just created of course) from within SciTE (Tools->Go):

Note: this is almost verbatim form the autoit help file, i just modified it for my purposes within the longer and above example scripts

$IniFile = "D:\TrueCrypt\Robocopy.ini"

$CopyLines = IniReadSection($IniFile, "Copy")
If @error Then
    MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
    For $i = 1 To $CopyLines[0][0]

        MsgBox(0, "Test", @CRLF & "CopyLine number: " & $i & "   Source: " & $CopyLines[$i][0] & "   Destination: " & $CopyLines[$i][1])
    Next
EndIf

Now the full revised script:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=1 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

; variables

;====TrueCrypt Settings =========
;$TC_Exe - path to truecrypt executable
$TC_Exe = "D:\TrueCrypt\TrueCrypt.exe"
;truecrypt container path
$TC_Path = "i:\test"
; truecrypt driveletter assign
$TC_DriveLetter = "x"
;truecrypt password
$TC_Password =  "test123"

;====Netowork Share Settings =========
;MapDriveMachineName - name of machine that has drive you wish to map, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$MapDriveMachineName = "computername"
;MapDrivePath1 - the 1st path on the machine you wish to share
$MapDrivePath1 = "\path"
;MapDrivePath2 - the 2nd path on the machine you wish to share
$MapDrivePath2 = "\path"
;NetworkDomain - name of domain that contains your user credentials, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$NetworkDomain = "domain"
;NetworkUsername - your network username
$NetworkUsername = "username"
;NetworkPassword - your network password
$NetworkPassword = "password"

;====Robocopy Settings =========
;$RC_Path - path to robocopy
$RC_Path = "D:\Robocopy\robocopy.exe"
;$RC_Options - robocopy options
$RC_Options = "/e /copyall"
;$RC_Source - source path
$RC_Source = "D:\source"
;$RC_Destination - source path
$RC_Destination = "D:\destination"
;$RC_Ini -  a file containing multiple source and destination folders
; this file will have a heading of [Copy]
; then under heading a separate source=destination on its onw line for each copy job
; i.e.:
;
;[Copy]
;c:\temp=d:\temp
;c:\windows=e:\windows
;d:\programs=f:\programs
$RC_Ini = "D:\TrueCrypt\Robocopy.ini"




; script start

;Mount True Crypt Volume
$TCMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /v " & $TC_Path & " /l" & $TC_DriveLetter & " /p " & $TC_Password)

If NOT @error Or $TCMount == 0 Then

	;write the success of truecrypt monting to the console
	ConsoleWrite(@CRLF & "Successfully mounted: "& $TC_Path & " to Drive: " & $TC_DriveLetter)

	; Map drives
	$Map1_Add = DriveMapAdd("y:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath1, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map1_Add == 1 Then
		ConsoleWrite("Successfully mapped network drive: " & $MapDrivePath1)
		SetError(0)
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath1  & " the error returned is: " & @extended)
		Exit
	EndIf

	$Map2_Add = DriveMapAdd("z:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath2, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map2_Add == 1 Then
		ConsoleWrite("Successfully mapped network drive: " & $MapDrivePath2)
		SetError(0)
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath2  & " the error returned is: " & @extended)
		Exit
	EndIf

	;Robocopy stuff
	$CopyLines = IniReadSection($RC_Ini, "Copy")
	If @error Then
		MsgBox(4096, "", "Error occurred, probably no INI file.")
	Else
		For $i = 1 To $CopyLines[0][0]
		$RoboCopy = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, $RC_Path & " " & $RC_Options & " " & $CopyLines[$i][0] & " " & $CopyLines[$i][1])
		;Write copy result to console
		Switch @error
			Case 0
				ConsoleWrite("No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.")
			Case 1
				ConsoleWrite("All files were copied successfully.")
			Case 2
				ConsoleWrite("There are some additional files in the destination directory that are not present in the source directory. No files were copied.")
			Case 3
				ConsoleWrite("Some files were copied. Additional files were present. No failure was encountered.")
			Case 5
				ConsoleWrite("Some files were copied. Some files were mismatched. No failure was encountered.")
			Case 6
				ConsoleWrite("Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory.")
			Case 7
				ConsoleWrite("Files were copied, a file mismatch was present, and additional files were present.")
		EndSwitch
		;According to MS any error code greater than 8 means a robocopy failure
		If @error >= 8 Then
			ConsoleWrite("Robocopy failed, the error returned is: " & @error)
		Exit
		Else
		EndIf
		Next
	EndIf

	;whack in a quick 2 second sleep
	Sleep(2000)

        ;UnMap Drives
	$Map1_Del = DriveMapDel("y:")
	$Map2_Del = DriveMapDel("z:")

	;Un-Mount True Crypt Volume
	$TCUnMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /d " & $TC_DriveLetter)
	If @error Or $TCUnMount > 0 Then
		ConsoleWrite(@CRLF & "Failed to unmount: "& $TC_Path & " from Drive " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCUnMount)
	EndIf
	ConsoleWrite(@CRLF & "Successfully unmounted: "& $TC_Path & " from Drive: " & $TC_DriveLetter)
	Exit

Else
	;write the failure of truecrypt mounting to the console
	ConsoleWrite("Failed to mount: "& $TC_Path & " to Drive: " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCMount)
EndIf

As before, this is a BASIC script, and there may be errors i havent seen with my tired eyes (eagle eyed viewers will note that each revision clears up typos in particular) and there may be ways in which functionality can be improved upon (This is a stripped down wham bam example of functions and program flow), im just too tired after a big day to give it any more attention tonight. Any questions, PM me, ill be back tomorrow.

Corrected 3 errors that i missed last night (in DriveMapAdd section, using == operators for numerics doesnt work, been a while since i programmed anything)

Fixed, sorry folks

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Run_Obfuscator=y
#Obfuscator_Parameters=/cs=1 /cn=1 /cf=1 /cv=1 /sf=1 /sv=1
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

; variables

;====TrueCrypt Settings =========
;$TC_Exe - path to truecrypt executable
$TC_Exe = "D:\TrueCrypt\TrueCrypt.exe"
;truecrypt container path
$TC_Path = "i:\test"
; truecrypt driveletter assign
$TC_DriveLetter = "x"
;truecrypt password
$TC_Password =  "test123"

;====Netowork Share Settings =========
;MapDriveMachineName - name of machine that has drive you wish to map, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$MapDriveMachineName = "computername"
;MapDrivePath1 - the 1st path on the machine you wish to share
$MapDrivePath1 = "\path"
;MapDrivePath2 - the 2nd path on the machine you wish to share
$MapDrivePath2 = "\path"
;NetworkDomain - name of domain that contains your user credentials, if on same machine, then you can use @ComputerName , no quotations marks around this, its an autoit macro.
$NetworkDomain = "domain"
;NetworkUsername - your network username
$NetworkUsername = "username"
;NetworkPassword - your network password
$NetworkPassword = "password"

;====Robocopy Settings =========
;$RC_Path - path to robocopy
$RC_Path = "D:\Robocopy\robocopy.exe"
;$RC_Options - robocopy options
$RC_Options = "/e /copyall"
;$RC_Source - source path
$RC_Source = "D:\source"
;$RC_Destination - source path
$RC_Destination = "D:\destination"
;$RC_Ini -  a file containing multiple source and destination folders
; this file will have a heading of [Copy]
; then under heading a separate source=destination on its onw line for each copy job
; i.e.:
;
;[Copy]
;c:\temp=d:\temp
;c:\windows=e:\windows
;d:\programs=f:\programs
$RC_Ini = "D:\TrueCrypt\Robocopy.ini"




; script start

;Mount True Crypt Volume
$TCMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /v " & $TC_Path & " /l" & $TC_DriveLetter & " /p " & $TC_Password)

If NOT @error Or $TCMount = 0 Then

	;write the success of truecrypt monting to the console
	ConsoleWrite(@CRLF & "Successfully mounted: "& $TC_Path & " to Drive: " & $TC_DriveLetter)

	; Map drives
	$Map1_Add = DriveMapAdd("y:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath1, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map1_Add = 1 Then
		ConsoleWrite("Successfully mapped network drive: " & $MapDrivePath1)
		SetError(0)
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath1  & " the error returned is: " & @extended)
		Exit
	EndIf

	$Map2_Add = DriveMapAdd("z:", "\\" & $MapDriveMachineName & "\" & $MapDrivePath2, 0, $NetworkDomain & "\" & $NetworkUsername, $NetworkPassword)
	If $Map2_Add = 1 Then
		ConsoleWrite("Successfully mapped network drive: " & $MapDrivePath2)
		SetError(0)
	Else
		ConsoleWrite("Failed to map network drive: " & $MapDrivePath2  & " the error returned is: " & @extended)
		Exit
	EndIf

	;Robocopy stuff
	$CopyLines = IniReadSection($RC_Ini, "Copy")
	If @error Then
		MsgBox(4096, "", "Error occurred, probably no INI file.")
	Else
		For $i = 1 To $CopyLines[0][0]
		$RoboCopy = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, $RC_Path & " " & $RC_Options & " " & $CopyLines[$i][0] & " " & $CopyLines[$i][1])
		;Write copy result to console
		Switch @error
			Case 0
				ConsoleWrite("No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.")
			Case 1
				ConsoleWrite("All files were copied successfully.")
			Case 2
				ConsoleWrite("There are some additional files in the destination directory that are not present in the source directory. No files were copied.")
			Case 3
				ConsoleWrite("Some files were copied. Additional files were present. No failure was encountered.")
			Case 5
				ConsoleWrite("Some files were copied. Some files were mismatched. No failure was encountered.")
			Case 6
				ConsoleWrite("Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory.")
			Case 7
				ConsoleWrite("Files were copied, a file mismatch was present, and additional files were present.")
		EndSwitch
		;According to MS any error code greater than 8 means a robocopy failure
		If @error >= 8 Then
			ConsoleWrite("Robocopy failed, the error returned is: " & @error)
		Exit
		Else
		EndIf
		Next
	EndIf

	;whack in a quick 2 second sleep
	Sleep(2000)

        ;UnMap Drives
	$Map1_Del = DriveMapDel("y:")
	$Map2_Del = DriveMapDel("z:")

	;Un-Mount True Crypt Volume
	$TCUnMount = RunAsWait($NetworkUsername, $NetworkDomain, $NetworkPassword, 0, "D:\TrueCrypt\TrueCrypt.exe /q /d " & $TC_DriveLetter)
	If @error Or $TCUnMount > 0 Then
		ConsoleWrite(@CRLF & "Failed to unmount: "& $TC_Path & " from Drive " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCUnMount)
	EndIf
	ConsoleWrite(@CRLF & "Successfully unmounted: "& $TC_Path & " from Drive: " & $TC_DriveLetter)
	Exit

Else
	;write the failure of truecrypt mounting to the console
	ConsoleWrite("Failed to mount: "& $TC_Path & " to Drive: " & $TC_DriveLetter & @CRLF  & "ExitCode: " & @error & "TrueCrypt returned error: " & $TCMount)
EndIf

That's looking great. Thank you.

Is here a way to exclude folders in a job? Also, I think it would be better to have the robocopy options in the INI file so that when more jobs are added they can have different options.

Also, there's two lines that have "D:\TrueCrypt\TrueCrypt.exe" . Should that be in the script?

  On 23/07/2010 at 01:37, unknownsoldierX said:

That's looking great. Thank you.

Is here a way to exclude folders in a job? Also, I think it would be better to have the robocopy options in the INI file so that when more jobs are added they can have different options.

Also, there's two lines that have "D:\TrueCrypt\TrueCrypt.exe" . Should that be in the script?

Well spotted, very tired here lol

I forgot to substitute those lines with $TC_Exe, ill post the (yet again) fixed script when i have answered your second question...

As for adding the ability to have different options for each job, well thats going to involve a bit of a rewrite....since you originally were going to keep the same options i did it the quick easy way, now we get to play with some more array functions, StringSplit time methinks...

Gimme a little while....

There's a robocopy option for excluding folders. /xd

robocopy.exe D:\Folder \\computername\Folder /mir /zb /dcopy:T /copyall /xd "D:\Folder\Downloads" /xa:h

I think it would be easier to make changes later if the robocopy options where stored in the INI file.

Heres how to do the robocopy options via ini file method in a quick test:

1) Change the format of the ini file

- Will use key as numerical increment so you can troubleshoot by line if theres an error, the script will tell you which line to look at

- Will add all 3 options (robocopy options, source, destination) as a value, split by commas ","

demo ini file (robocopy.ini for purpose of test):

[Copy]
1=/e /copyall,c:\temp,d:\temp
2=/mir,c:\windows,e:\windows
3=/e,d:\programs,f:\programs
4=/mir /e,f:\test,g:\test2

2) quick test script to show this in use, again can run without being compiled, just use Tools->Go in SciTe:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Array.au3>;

$IniFile = "D:\TrueCrypt\Robocopy.ini"
;read iniffile section [Copy] and return the key/value pairs underneath into 2 dimensional array [0][0]
$CopyLines = IniReadSection($IniFile, "Copy")
If @error Then
	;if no ini file found or other error, show mesagebox
        MsgBox(4096, "", "Error occurred, probably no INI file.")
Else
	;otherwise if no error, continue on
	;set loop to run as many times as there are key/value pairs
        For $i = 1 To $CopyLines[0][0]
		;split value (containing ROBOCOPYOPTIONS,SOURCE,DESTINATION) into 3 seperate variables at the comma
		$CopyLinesSplit = StringSplit($CopyLines[$i][1], ",")
		;if there are not 3 values split by a comma then show error and move to the next value
		If $CopyLinesSplit[0] < 3 Then
		         MsgBox(0, "Test", "Missing value in Ini File, key number: " & $i & "   expecting Robocopy Options, Source, Destination. One is missing")
		Else
		         ;check for empty element in returned array, this would mean you had put a comma after say source but failed to put in a value destination
		         $CheckEmpty = _ArraySearch($CopyLinesSplit, "", 1)
		         ;if a blank value is NOT found, continue script, in this case @error is actually good :)
		         If @error Then
		                 ;set robocopy variable from the first element of $CopyLinesSplit array
		                 $RoboCopyOptions = $CopyLinesSplit[1]
		                 ;set source variable from the second element of $CopyLinesSplit array
		                 $CopySource = $CopyLinesSplit[2]
		                 ;set destination from the third element of $CopyLinesSplit array
		                 $CopyDestination = $CopyLinesSplit[3]
                                 MsgBox(0, "Test", "Ini file key number: " & $i &  "   RoboCopy Options: " & $RoboCopyOptions &  "   Source: " & $CopySource & "   Destination: " & $CopyDestination)
		        Else
			         ;if a blank value is found, display message box
			         MsgBox(0, "Test", "Missing value after comma in Ini File, key number: " & $i & "   expecting Robocopy Options, Source, Destination. One is missing after a comma")
		        EndIf
		EndIf
    Next
EndIf

There is also error checking in case you had an ini file line that went (missing a value after a comma):

2=/mir,c:\windows,

And also if you missed a comma totally, it will always check for 3 values, so the following would error:

3=/e,d:\programs

So try the following modified ini file contents with the script and youll see what i mean

[Copy]
1=/e /copyall,c:\temp,d:\temp
2=/mir,c:\windows,
3=/e,d:\programs
4=/mir /e,f:\test,g:\test2

Im adding this new stuff to the script and a bit of logging etc, and will post it soon...i should have started this today instead of last night after I'd had some sleep!

In case youre wondering what the delay is...im having a bit of a fight with robocopy on exit codes at the moment

All else is done, i have dug out a copy of robocopy and have the script doing multiple jobs with multiple options with errors/info output to both the console (commandline) and logging to a text file

The file copying is working fine on each job, just robocopy gives the wrong exit code at the moment, im having to find a definitive list of exit codes that work properly

should have this small hitch fixed soon

The only thing i cannot test in all this script is the drive mapping...

Heres a quick squiz at what you see both at the commandline and in the logfile....

Attempting to mount truecrypt volume:  D:\test  on drive letter:  z ....

Successfully mounted:  D:\test to Drive:  z

About to start Robocopy job number:  1
RoboCopy Options:  /e /copyall
Source Folder:  d:\temp
Destination Folder:  z:\test

No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.

About to start Robocopy job number:  2
RoboCopy Options:  /mir
Source Folder:  d:\temp
Destination Folder:  z:\test2

No files were copied. No failure was encountered. No files were mismatched. The files already exist in the destination directory; therefore, the copy operation was skipped.

Successfully unmounted:  D:\test from Drive:  z

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

    • No registered users viewing this page.
  • Posts

    • Plasma 6.5 brings improved Emoji Selector, better performance in Activity manager, and more by David Uzondu This week saw the long-awaited release of KDE Plasma 6.4, bringing better window management and a whole lot of color management features. Apart from the release of 6.4, the KDE team was able to get other work done, and this was all outlined in the latest issue of This Week in Plasma, which details what is coming down the pipe for future versions. Looking ahead to Plasma 6.5, the developers are making some notable changes to improve performance and general usability. To prevent its database from growing endlessly and causing performance problems over time, the Activity Manager service will now only store the last four months of your history by default. The Emoji selector app is also getting a much-needed redesign that makes the window more compact and moves the sidebar button to the header for a cleaner look. Other little details for 6.5 are being polished up too. The unpopular vertical line separating the date and time on the horizontal Digital Clock widget is gone; if you want it back, you can add it yourself with a custom date format. The "Add New" button has also been moved to the top toolbar in the Shortcuts page within Settings, freeing up some valuable screen real estate. The devs also reduced the minimum size of custom tiling tiles, a small but significant fix for anyone with an ultrawide monitor. In addition to that, the Networks widget's captive portal banner now uses inline header styling, so it doesn't look like a bunch of frames stacked inside each other anymore. Of course, before we get to 6.5, the current release needs some attention. Plasma 6.4's first bug fix release, 6.4.1, addresses issues like broken item selection in the Folder View widget and a bug that could cause the system to lock or suspend faster than intended. Keyboard navigation in list views in Discover feels smoother now, and text is easier to read in certain list items in KRunner. The devs also cleaned up how list items look when you press or click them in Discover. 6.4.1 also fixes a bug where the clipboard history popup would fail to select the top item, and makes the Earth Science Picture of The Day wallpaper plugin work again after its data source changed. Here's the full list of fixes: Fixed several issues in the Folder View widget that caused selecting or opening items to not work when using certain non-default view settings, when the view was scrollable, or when using a touchscreen. Fixed a bug in the Meta+V clipboard popup that sometimes failed to pre-select the top-most item. The Clipboard settings window’s shortcuts page no longer shows columns for local shortcuts that don’t do anything, since the clipboard is global in scope. Fixed the Earth Science Picture of the Day wallpaper plugin after the source data changed formatting again. Made a few fixes to the “Missing Backends” section of Discover’s settings window that kept it from working properly. Fixed a bug that prevented direct scan-out (and its performance benefits) from activating on rotated screens. Fixed an issue where the system could lock or suspend sooner than expected after an app stopped blocking those actions. Installing a new wallpaper plugin no longer causes the plugin list combobox to appear blank. The team even went back to squash some bugs in the older 6.3.6, tackling an issue that could cause keyboard shortcuts to get lost during a system upgrade and fixing an overflow bug with KRunner's faded completion text. Plasma 6.4.1 is set to arrive on June 24th, with 6.3.6 following on July 8th.
    • UniGetUI 3.2.1 Beta 1 by Razvan Serea UniGetUI is an application whose main goal is to create an intuitive GUI for the most common CLI package managers for Windows 10 and Windows 11, such as Winget, Scoop and Chocolatey. With UniGetUI, you'll be able to download, install, update and uninstall any software that's published on the supported package managers — and so much more. UniGetUI features Install, update and remove software from your system easily at one click: UniGetUI combines the packages from the most used package managers for windows: WinGet, Chocolatey, Scoop, Pip, Npm and .NET Tool. Discover new packages and filter them to easily find the package you want. View detailed metadata about any package before installing it. Get the direct download URL or the name of the publisher, as well as the size of the download. Easily bulk-install, update or uninstall multiple packages at once selecting multiple packages before performing an operation Automatically update packages, or be notified when updates become available. Skip versions or completely ignore updates in a per-package basis. Manage your available updates at the touch of a button from the Widgets pane or from Dev Home pane with UniGetUI Widgets. The system tray icon will also show the available updates and installed package, to efficiently update a program or remove a package from your system. Easily customize how and where packages are installed. Select different installation options and switches for each package. Install an older version or force to install a 32bit architecture. [But don't worry, those options will be saved for future updates for this package] Share packages with your friends to show them off that program you found. Here is an example: Hey @friend, Check out this program! Export custom lists of packages to then import them to another machine and install those packages with previously-specified, custom installation parameters. Setting up machines or configuring a specific software setup has never been easier. Backup your packages to a local file to easily recover your setup in a matter of seconds when migrating to a new machine UniGetUI 3.2.1 Beta 1 changelog: Added per-package-manager default install options Added the ability to run pre-install/update/uninstall and post-install/update/uninstall commands Added the ability to kill process(es) before a package is installed/updated/uninstalled Block custom command-line arguments (and pre/post commands) behind a SecureSetting switch SecureSettings are settings that require administrator privileges to be switched. Bundles won't import custom arguments & custom commands by default Bundles will show a security report when importing potentially dangerous settings Added a better crash message for when UniGetUI files are missing Deep improvements to how bundles and InstallOptions are loaded from disk. Improvements to WebView lifecycle Download: UniGetUI 3.2.1 Beta 1 | 51.7 MB (Open Source) Links: WingetUI Home Page | GitHub | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I'm just waiting on what they will do when outlook doesn't load properly, and you have to set a new profile as a test.
    • Weekend PC Game Deals: Rhythm bundles, fishing festivals, and DRM-free summer sales by Pulasthi Ariyasinghe Weekend PC Game Deals is where the hottest gaming deals from all over the internet are gathered into one place every week for your consumption. So kick back, relax, and hold on to your wallets. The Humble Store introduced the June Tunes collection this week. Coming in with music and rhythm titles, the bundle begins with Wanderson, Everhood, and Onde in the first tier for $5. Going up a tier by paying $8 gets you three more games: Rhythm Fighter, One Btn Bosses, and Oddada. Lastly, Trombone Champ, DJMAX RESPECT V, and Ragnarock lead the final tier, which are yours for $10. Just yesterday, Humble also brought out the Serenity Forge Storyteller's Bundle. This carries 12 indie games inside it, including LISA the Joyful and LISA the Painful, Neversong, Death's Gambit, Smile for Me, Long Gone Days, and more, all split into three tiers of prices. Replacing Two Point Hospital, The Operator landed as the latest freebie on the Epic Games Store earlier this week. The 2024-released indie title has you taking the role of a new hire at the Federal Department of Intelligence (FDI). Here you have to analyze evidence, fact-check, and try to solve a streak of mysterious crimes using the agency's advanced investigative software. However, as the story progresses, a conspiracy is revealed that paints the FDI in a different light. The Operator giveaway on the Epic Games Store is slated to last until June 26. On the same day, Sable will become the next freebie in the promotion. Free Events If you're looking to try out some games over the weekend without opening your wallet, there are three games having free weekend offers right now. Starting off, Paradox is offering its grand strategy experience, Victoria 3, to try out. The title has a much higher focus on state management than war and roleplaying compared to the company's other games. If that's too much of a tough start, Len's Island is temporarily free-to-play now too. This is a top-down perspective survival game with support for up to eight players in co-op, with combat, farming, dungeon diving, and other elements being included. Lastly, Dead by Daylight should be the most familiar to most. The multiplayer four-versus-one asymmetric survival horror game has you assuming the roles of survivors or the killer to see who can come out on top. Big Deals With the Steam Summer Sale only being days away, most publishers and developers are laying low to prepare for the big event. Still, we found quite a few games having some attractive discounts. Here's our hand-picked big deals list for this weekend: Red Dead Redemption – $29.99 on Steam Mount & Blade II: Bannerlord – $24.99 on Steam Timberborn – $24.49 on Steam BERSERK and the Band of the Hawk – $23.99 on Steam Wo Long: Fallen Dynasty – $23.99 on Steam Disney Epic Mickey: Rebrushed – $23.99 on Steam Jagged Alliance 3 – $22.49 on Steam [NINJA GAIDEN: Master Collection] NINJA GAIDEN Σ2 – $19.99 on Steam Alone in the Dark – $19.99 on Steam Last Train Home – $19.99 on Steam Len's Island – $19.49 on Steam Nightingale – $17.99 on Steam DYNASTY WARRIORS 8: Xtreme Legends Complete Edition – $16.99 on Steam Mortal Kombat 1 – $16.49 on Steam SOMA – $14.99 on Steam Victoria 3 – $14.99 on Steam Trepang2 – $14.99 on Steam Blasphemous 2 – $14.99 on Steam Wreckfest – $14.99 on Steam Expeditions: Rome – $14.84 on Steam EA SPORTS FC 25 – $13.99 on Steam STAR WARS Jedi: Survivor – $13.99 on Steam DRAGON BALL Z: KAKAROT – $12.99 on Gamesplanet Amnesia: The Bunker – $12.49 on Steam DREDGE – $12.49 on Steam Dead Space – $11.99 on Steam DAVE THE DIVER – $11.99 on Steam WILD HEARTS – $10.49 on Steam It Takes Two – $9.99 on Steam Dragon Age Inquisition – $9.99 on Steam Haven – $9.99 on Steam Hellboy Web of Wyrd – $9.99 on Steam Nova Lands – $9.99 on Steam BIOMUTANT – $9.99 on Steam Destroy All Humans! 2 - Reprobed – $9.99 on Steam Ghostrunner 2 – $9.99 on Steam Need for Speed Unbound – $9.79 on Steam Call of the Wild: The Angler – $8.99 on Steam DEAD OR ALIVE 6 – $8.99 on Steam Operation: Tango – $8.99 on Steam Katana ZERO – $8.99 on Steam Dead by Daylight – $7.99 on Steam Killer Frequency – $7.49 on Steam Nioh: Complete Edition – $7.49 on Steam Overcooked! 2 – $6.24 on Steam A Way Out – $5.99 on Steam Mass Effect Legendary Edition – $5.99 on Steam Darksiders Genesis – $5.99 on Steam Mortal Kombat 11 – $4.99 on Steam Titanfall 2 – $4.49 on Steam Golf With Your Friends – $4.49 on Steam STAR WARS Battlefront II – $3.99 on Steam Yoku's Island Express – $3.99 on Steam theHunter: Call of the Wild – $3.99 on Steam RoboCop: Rogue City – $3.74 on Fanatical Battlefield 2042 – $2.99 on Steam Road Redemption – $2.99 on Steam Shadow Warrior 2 – $2.99 on Steam Battlefield V – $2.49 on Steam Ultimate Fishing Simulator – $1.99 on Steam DRM-free Specials The GOG store has already kicked off its own summer sale, putting thousands of DRM-free games on sale. Here are some highlights: Cyberpunk 2077 - $23.99 on GOG God of War - $19.99 on GOG Fallout 4: Game of the Year Edition - $15.99 on GOG Fallout 4: Game of the Year Edition - $15.99 on GOG Dino Crisis Bundle - $15.29 on GOG Devil May Cry HD Collection & 4SE Bundle - $14.84 on GOG The Witcher 3: Wild Hunt - Complete Edition - $9.99 on GOG Vampire: The Masquerade - Bloodlines - $9.99 on GOG SPORE Collection - $7.49 on GOG Papers, Please - $4.99 on GOG Terraria - $4.99 on GOG SWAT 4: Gold Edition - $4.99 on GOG DOOM (2016) - $3.99 on GOG DOOM 3 - $3.99 on GOG CrossCode - $3.99 on GOG Mad Max - $2.99 on GOG Heroes of Might and Magic 3: Complete - $2.49 on GOG Heroes of Might and Magic 4: Complete - $2.49 on GOG World in Conflict: Complete Edition - $2.49 on GOG Alan Wake - $1.49 on GOG Mortal Kombat 1+2+3 - $1.49 on GOG RollerCoaster Tycoon Deluxe - $1.19 on GOG Keep in mind that availability and pricing for some deals could vary depending on the region. That's it for our pick of this weekend's PC game deals, and hopefully, some of you have enough self-restraint not to keep adding to your ever-growing backlogs. As always, there are an enormous number of other deals ready and waiting all over the interwebs, as well as on services you may already subscribe to if you comb through them, so keep your eyes open for those, and have a great weekend.
    • Is there a 'recovery' settings option in Settings? The one where we can rollback to a previous restore point. I find it very useful if there is some issue and I have to rollback to the last stable point.
  • Recent Achievements

    • Contributor
      GravityDead went up a rank
      Contributor
    • Week One Done
      BlakeBringer earned a badge
      Week One Done
    • Week One Done
      Helen Shafer earned a badge
      Week One Done
    • First Post
      emptyother earned a badge
      First Post
    • Week One Done
      Crunchy6 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      669
    2. 2
      ATLien_0
      269
    3. 3
      Michael Scrip
      238
    4. 4
      Steven P.
      165
    5. 5
      +FloatingFatMan
      157
  • Tell a friend

    Love Neowin? Tell a friend!