1

I made a script that executes an EXE, which changes fan speed of my laptop. But on boot I get annoying console popup, how do I make it go away?

vbscript:

Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "DellFanCmd", "ec-disable-nofanchg", "", "runas", 1
objShell.ShellExecute "DellFanCmd", "fan1-level1", "", "runas", 1

Thanks

John Bielowski
  • 199
  • 2
  • 11

1 Answers1

2

Refer to ShellExecute method

Syntax

.ShellExecute "application", "parameters", "dir", "verb", window
.ShellExecute 'some program.exe', '"some parameters with spaces"', , "runas", 1

Key

application   The file to execute (required)
parameters    Arguments for the executable
dir           Working directory
verb          The operation to execute (runas/open/edit/print)
window        View mode application window (normal=1, hide=0, 2=Min, 3=max, 4=restore, 5=current, 7=min/inactive, 10=default)

So your code can be written as below by changing 1 to 0

Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "DellFanCmd", "ec-disable-nofanchg", "", "runas", 0
objShell.ShellExecute "DellFanCmd", "fan1-level1", "", "runas", 0
Hackoo
  • 18,337
  • 3
  • 40
  • 70