Introduction: Fix Validation Errors With Steam Games (Windows)

In this instructable i wil teach you how to make a vbscript in notepad that will fix validation errors with steam games such as portal 2 and then give you the option th launch them.
It will also give you some idea about writing your own vbscript.

Step 1: Setting Up Notepad

If you already know how to set up a vbscript you can skip this step.
Open up Notepad and save as "[your game here] fix.vbs"  make sure that the file type is set to All Files.
Now your notepad is ready to write your script.

Step 2: Starting the Script, the Popup Box

I will use Portal 2 as an example in this script because that is the game that i originally wrote it for but it should work with any other steam games that get this error.
So to start with we will make the popup box to inform the user the purpose of the script.
first write out what keyword will represent that section of script so we will just use msg. Then write =msgbox this means that msg will now represent the message box. now place a (" to show that you are starting the message box script. then write something like this, ("This applet is to fix verification issues involving Portal 2.",  make sure that you include the speech marks and comma at the end. Now we will just write 16, "Verification error Fix app Info") this just specifies the popup box icon and the title bar text.
now you should have something like this,
msg=msgbox("This applet is to fix verification issues involving Portal 2.", 16, "Verification error Fix app Info")

Step 3: The Fix

now go down a couple of lines and now we are going to start on the section of the script that actually fixes the problem.
so copy and paste this text

dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("C:\Program Files (x86)\Steam\SteamApps\[steam username]\[gamename]\steam_appid.txt", Forwriting, True)
filetxt.WriteLine("[game name+id]")
filetxt.Close


the filetxt command is used to create or edit a text file in a specified location
the Forwriting section means that the script will write to the file nothing more.
replace [steam username] with the username you use to log in to steam.  (if this doesnt work try using common instead.)
replace [gamename] with the name of your game
replace [game name+id] with one of the names and ids below in this format Portal 2 400
[5]
Name=Dedicated Server
[10]
Name=Counter-Strike
[20]
Name=Team Fortress Classic
[30]
Name=Day of Defeat
[40]
Name=Deathmatch Classic
[50]
Name=Opposing Force
[60]
Name=Ricochet
[70]
Name=Half-Life
[80]
Name=Condition Zero
[100]
Name=Condition Zero Deleted Scenes
[130]
Name=Half-Life: Blue Shift
[205]
Name=Source Dedicated Server
[211]
Name=Source SDK
[215]
Name=Source SDK Base
[218]
Name=Source SDK Base - Orange Box
[220]
Name=Half-Life 2
[240]
Name=Counter-Strike: Source
[280]
Name=Half-Life: Source
[300]
Name=Day of Defeat: Source
[310]
Name=Team Fortress 2 Dedicated Server
[320]
Name=Half-Life 2: Deathmatch
[340]
Name=Half-Life 2: Lost Coast
[360]
Name=Half-Life Deathmatch: Source
[380]
Name=Half-Life 2: Episode One
[400]
Name=Portal
[420]
Name=Half-Life 2: Episode Two
[440]
Name=Team Fortress 2
[1300]
Name=SiN Episodes: Emergence
[1317]
Name=Sin Episodes SDK
[2100]
Name=Dark Messiah Might and Magic Single Player
[2130]
Name=Dark Messiah Might and Magic Multi-Player
[2145]
Name=Dark Messiah Might and Magic Dedicated Server
[2150]
Name=Dark Messiah SDK Beta
[2400]
Name=The Ship
[2403]
Name=The Ship Dedicated Server
[2420]
Name=The Ship Single Player
[2430]
Name=The Ship Tutorial
[4000]
Name=Garry's Mod
[17500]
Name=Zombie Panic! Source
[17505]
Name=Zombie Panic! Source Dedicated Server
[17510]
Name=Age of Chivalry
[17515]
Name=Age of Chivalry Dedicated Server
[17520]
Name=Synergy
[17525]
Name=Synergy Dedicated Server
[17530]
Name=D.I.P.R.I.P. Warm Up
[17535]
Name=D.I.P.R.I.P. Dedicated Server
[17550]
Name=Eternal Silence
[17555]
Name=Eternal-Silence Dedicated Server
[17580]
Name=Dystopia
[17585]
Name=Dystopia Dedicated Server
[17700]
Name=Insurgency
[17705]
Name=Insurgency Dedicated Server


NOTE: if your operating system is 32 bit then make sure that you write just Program Files instead of Program Files (x86)

Step 4: Final Msgbox and Game Launch

Now we will make a message box with yes or no buttons to choose wether to launch the game or not.
so first write out a msgbox like  before but in this format
finished=msgbox("Portal 2 has now been fixed. do you wan't to play it?", vbyesno, "play")
the vbyesno portion will give the popup box the yes and no buttons allowing other sections of the script to use the result.
now we will write a section of script that will launch the game if yes is selected.

if finished = vbyes then
strProgramPath = """[your game exe path]"""

end if

set objShell = createobject("Wscript.Shell")

objShell.Run strProgramPath

this will run the game if yes is selected on the finished box. You will get an error message if you select no but that is perfectly normal.
replace [your game exe path] with the path of the game exe in your steam folder steamapps 

Step 5: Finished

Now just save the file and launch it to make sure that everything works fine. you will need to run this script every time you play the game.

Game.Life 2 Challenge

Participated in the
Game.Life 2 Challenge