Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
dela_dela pe Simpatie.ro
Femeie
24 ani
Bucuresti
cauta Barbat
24 - 48 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [JAVASCRIPT] JS Alternative to VBS for Creating an InputBox Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
Mrrrr
AdMiN

Inregistrat: acum 19 ani
Postari: 2386
To run .js files natively in Windows (like you would with a .vbs script), make sure it opens with Microsoft Windows Based Script Host by default.

The code below calls powershell (no admin required) and displays a simple InputBox:


var shell = WScript.CreateObject("WScript.Shell");

// Added -WindowStyle Hidden to prevent window flickering
var psCmd = "powershell -NoProfile -WindowStyle Hidden -Command \"[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic'); [Microsoft.VisualBasic.Interaction]::InputBox('Enter value:', 'Title')\"";

var exec = shell.Exec(psCmd);
var result = exec.StdOut.ReadAll().replace(/\r?\n|\r/g, "");

WScript.Echo("Result: " + result);


_______________________________________


pus acum 3 saptamani
   
Pagini: 1  

Mergi la