2

I have a batch file with this content:

@echo off
if not exist %SystemDrive%\ntldr (Start "" /b %windir%\system32\msconfig.exe -4) else (Start "" /b %windir%\pchealth\helpctr\binaries\msconfig.exe -6)

and create a hta file with this content :

<html>
<script>
  function RunExe() {
    var shell = new ActiveXObject("WScript.Shell");
    var path = '"msconfig-startup-tab_xp~7.bat"';
    shell.run(path, 1, false);
  }
</script>
<input style="width: 170px; height:23px; color: white; background-color: #203040; 
font-family:Book Antiqua;" type="button" Value="msconfig-startup-tab_xp~7" onClick="RunExe();" </html>
<html>
<script language="Vbscript">
  Function RunMe()
  Dim Shell, path
  Set shell = CreateObject("WScript.Shell")
  path = "msconfig-startup-tab_xp~7.bat"
  shell.run path, 1, false
  End Function
</script>
<input style="width: 170px; height:23px; color: white; background-color: #203040; 
font-family:Book Antiqua;" type="button" Value="Execute Batch File" onClick="RunMe()" </html>
<html>
<script language="Javascript">
  function RunMe1() {
    var shell = new ActiveXObject("WScript.Shell");
    var path = '"msconfig-startup-tab_xp~7.bat"';
    shell.run(path, 1, false);
  }
</script>
<input style="width: 170px; height:23px; color: white; background-color: #203040; 
font-family:Book Antiqua;" type="button" Value="Execute Batch File" onClick="RunMe1();" </html>

when i open hta file and click on any button in windows (xp-7-10) x86 and windows xp-x64 batch file run successful and open msconfig, but when i click buttons in windows 7 & 10 64-bit an error windows open (image) that says connot find msconfig.exe :

cannot find msconfig

Compo
  • 36,585
  • 5
  • 27
  • 39

0 Answers0