JSI Tip 9575. How can I invoke the Start/Run dialog from a script?


I have scripted StartRun.bat to invoke the Start menu Run dialog.

The syntax for using StartRun.bat is:

call StartRun \[W\]

Where W is an optional parameter that will pause your invoking script until you press a key.

StartRun.bat contains:

@echo off
setlocal
set arg=%1
if defined arg set arg=%arg:"=%
if not exist "%TEMP%\StartRun.vbs" @echo CreateObject("Shell.Application").FileRun>"%TEMP%\StartRun.vbs"
cscript //nologo "%TEMP%\StartRun.vbs"
if /i "%arg%" NEQ "W" goto finish
pause
:finish
endlocal



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish