[SOLVED] .bat File not running PLEASE HELP!!

Dec 5, 2018
7
0
10
Hi all,

Im trying to run this .bat file contained within a folder, however it does nothing as both administrator or double clicking. Running windows 10.

PLEASE HELP!

@set @ x = 0; / *
@echo off
if "% 1" == "" cscript.exe // nologo // e: jscript "% ~ f0" & Exit
chdir / d "% ~ dp0"

: m0
Echo.
Echo Choose a command:
Echo.
Echo 1 - Install Fix P3Dv4 P3Dv3
Echo 2 - Delit Fix
Echo 0 - exit
echo.

Set / p choice = "Your choice:"
if not defined choice goto m0
if "% choice%" == "1" goto m1
if "% choice%" == "2" goto m2
if "% choice%" == "0" goto end
Echo.
Echo Wrong selection, try again ...
Echo.
Echo.
goto m0

: m1

reg copy "hkcu \ SOFTWARE \ Lockheed Martin \ Prepar3D v4" "hkcu \ SOFTWARE \ Lockheed Martin \ Prepar3D v3" / s / f
reg copy "hklm \ SOFTWARE \ Lockheed Martin \ Prepar3D v4" "hklm \ SOFTWARE \ Lockheed Martin \ Prepar3D v3" / s / f
reg copy "hklm \ SOFTWARE \ Lockheed Martin \ Prepar3D v4" "hklm \ SOFTWARE \ Wow6432Node \ Lockheed Martin \ Prepar3D v3" / s / f
reg copy "hklm \ SOFTWARE \ Lockheed Martin \ Prepar3D v4 Content" "hklm \ SOFTWARE \ Wow6432Node \ Lockheed Martin \ Prepar3D v3 Content" / s / f
reg copy "hklm \ SOFTWARE \ Lockheed Martin \ Prepar3D v4 Scenery" "hklm \ SOFTWARE \ Wow6432Node \ Lockheed Martin \ Prepar3D v3 Scenery" / s / f

mklink / j "% USERPROFILE% \ Documents \ Prepar3D v3 Files" "% USERPROFILE% \ Documents \ Prepar3D v4 Files"> nul
mklink / j "% USERPROFILE% \ Documents \ Prepar3D v3 Add-ons" "% USERPROFILE% \ Documents \ Prepar3D v4 Add-ons"> nul
mklink / j "% APPDATA% \ Lockheed Martin \ Prepar3D v3" "% APPDATA% \ Lockheed Martin \ Prepar3D v4"> nul
mklink / j "% LOCALAPPDATA% \ Lockheed Martin \ Prepar3D v3" "%% LOCALAPPDATA% \ Lockheed Martin \ Prepar3D v4"> nul
mklink / j "% PROGRAMDATA% \ Lockheed Martin \ Prepar3D v3" "% PROGRAMDATA% \ Lockheed Martin \ Prepar3D v4"> nul

pause

goto m3

: m2

REG DELETE "hklm \ SOFTWARE \ Lockheed Martin \ Prepar3D v3" / f
REG delete "HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Lockheed Martin" / f
REG DELETE "hkcu \ SOFTWARE \ Lockheed Martin \ Prepar3D v3" / v Installed / f
REG DELETE "hkcu \ SOFTWARE \ Lockheed Martin \ Prepar3D v3" / v AppPath / f

rmdir / s / q "% USERPROFILE% \ Documents \ Prepar3D v3 Files"
rmdir / s / q "% USERPROFILE% \ Documents \ Prepar3D v3 Add-ons"
rmdir / s / q "% LOCALAPPDATA% \ Lockheed Martin \ Prepar3D v3"
rmdir / s / q "% APPDATA% \ Lockheed Martin \ Prepar3D v3"
rmdir / s / q "% PROGRAMDATA% \ Lockheed Martin \ Prepar3D v3"

pause

goto m3

: m3

exit

: end

exit

* / new ActiveXObject ('Shell.Application'). ShellExecute (WScript.ScriptFullName, 'Admin', '', 'runas', 1);

pause

 
Solution
I looked it up (very quickly) and it appears to be a "fix for water textures" or something like that.

Wherever you copied the batch file from has it wrong. There are multiple extra spaces in the batch file which cause errors. For example, the following line:
Set / p choice="Your choice:"
will not work because of the space after the / and before the p.
The line should be:
Set /p choice="Your choice:"
which works.

ss.jpg

I can't tell you all of the extra spaces in the batch. It would be better to find a better source for the batch. I think I found one (below).

I can't tell you the outcome of the batch file as I do not have the software. It's up to you if you want to trust it...
Dec 5, 2018
7
0
10
Correct, I do indeed, however I have updated to the new version of the Sim, following the update I am unable to install hence why I found a solution online (creating this .bat file) to override the installation issue I am having.
 

gardenman

Splendid
Moderator
I looked it up (very quickly) and it appears to be a "fix for water textures" or something like that.

Wherever you copied the batch file from has it wrong. There are multiple extra spaces in the batch file which cause errors. For example, the following line:
Set / p choice="Your choice:"
will not work because of the space after the / and before the p.
The line should be:
Set /p choice="Your choice:"
which works.

ss.jpg

I can't tell you all of the extra spaces in the batch. It would be better to find a better source for the batch. I think I found one (below).

I can't tell you the outcome of the batch file as I do not have the software. It's up to you if you want to trust it or not.

IF this is the same batch (and I have not verified that) then you might want to use this copy of the batch instead: https://pastebin.com/N2aKtkEd
Notice line 15 has the spacing correct. Copy it to the clipboard, paste it into Notepad and save it as Fix.bat then run it (if you trust it).
 
Solution