Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need to create .EXE file with three lines of code from VBScript

Featured Replies

Hi Guys,

I need some help. I have no experience with C++ but need to figure out how to write a .EXE that can do the following lines from my VBScript.

Set objWShell = CreateObject("WScript.Shell")

objWShell.Run "cmd.exe %systemroot%\system32\diskpart.exe /s %systemroot%\system32\ospart.txt",0,True

objWShell.Run "%systemroot%\System32\InstallOS.hta"

I need to create a MyShell.exe to call in my WinPE winpesh.ini file with those lines.

Has anyone done such a thing? I've tried four recomended conversion programs and none will run in WinPE 3.0.

Thanks for your help, if I'm asking too much then that is fine too.

Randy

Have you explored other avenues?

For example you could create a self extracting 7-zip executable file using the modified 7zip sfx here. Inside the archive you could place ospart.txt and InstallOS.hta, and run the diskpart and hta programs from your config file. This could also mean that you wouldn't have to pre-place your files in the system32 directory before running your executable.

Here's an example config.txt which may help if you decide that such an idea will suit.

;!@Install@!UTF-8!
GUIMode="2"
InstallPath="%SystemRoot%\\system32
OverwriteMode="1"
RunProgram="DiskPart.exe /s OSPart.txt"
Delete="OSPart.txt"
RunProgram="nowait:\"InstallOS.hta\""
;!@InstallEnd@!

I use a .hta as my shell under WinPE also.

You can add these lines:

Set objWShell = CreateObject("WScript.Shell")

objWShell.Run "cmd.exe %systemroot%\system32\diskpart.exe /s %systemroot%\system32\ospart.txt",0,True

to your InstallOS.hta and set the shell (in winpesh.ini) like this:

[LaunchApps]

%SystemRoot%\System32\wpeinit.exe

%SystemRoot%\System32\mshta.exe, %SystemRoot%\System32\InstallOS.hta

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.