diff --git a/src/sbbs3/bat_xfer.cpp b/src/sbbs3/bat_xfer.cpp
index 13c2674f1aa3fb747b1b0001c2106372c7c418b3..1eded6631fd12545070c710f373f9d15f6965603 100644
--- a/src/sbbs3/bat_xfer.cpp
+++ b/src/sbbs3/bat_xfer.cpp
@@ -584,8 +584,9 @@ bool sbbs_t::create_bimodem_pth()
 /****************************************************************************/
 void sbbs_t::batch_upload()
 {
-    char	str1[256],str2[256];
-	char 	tmp[512];
+    char	str1[MAX_PATH+1],str2[MAX_PATH+1];
+	char	path[MAX_PATH+1];
+	char 	tmp[MAX_PATH+1];
 	uint	i,j,x,y;
     file_t	f;
 	DIR*	dir;
@@ -631,7 +632,13 @@ void sbbs_t::batch_upload()
 			continue;
 		memset(&f,0,sizeof(file_t));
 		f.dir=cfg.upload_dir;
-		padfname(dirent->d_name,f.name);
+
+		SAFECOPY(path,str1);
+#ifdef _WIN32
+		GetShortPathName(str1, path, sizeof(path));
+#endif
+		padfname(getfname(path),f.name);
+
 		for(x=0;x<usrlibs;x++) {
 			for(y=0;y<usrdirs[x];y++)
 				if(cfg.dir[usrdir[x][y]]->misc&DIR_DUPES