diff --git a/src/d_main.c b/src/d_main.c
index 8519e6281aa82ac6f91cfa7fa3fd1c369bc0c02c..80f075cb1546c08818b8c8bda702c18c15ee48fb 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -909,7 +909,13 @@ static void IdentifyVersion(void)
 		}
 
 		CONS_Printf("%s\n", srb2path);
-		chdir(srb2path);
+
+#if defined (_WIN32)
+		SetCurrentDirectoryA(srb2path);
+#else
+		if (chdir(srb2path) == -1)
+			I_OutputMsg("Couldn't change working directory\n");
+#endif
 	}
 
 #if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)