/build/static/layout/Breadcrumb_cap_w.png

Hide Command prompt

I am trying to push out a vbs script via Kace 1000 v5.5 which works but the problem is the command prompt window diplaying and stays on the screen until the script completes.  Any ideas how to minimize or have the command prompt hidden so that the script can be ran 100% silent?


1 Comment   [ + ] Show comment
  • Google for 'start command line switches' - anonymous_9363 10 years ago

Answers (1)

Answer Summary:
Posted by: SMal.tmcc 10 years ago
Red Belt
1

Figured out how to make the bats run without needing the path to the bat file in the vbs script.

 

my script is:

CreateObject("Wscript.Shell").Run "runtest.bat",0,True

my bat file is:

reg.exe query hkcu\software\microsoft\windows\currentversion\run /s > C:\ProgramData\Dell\KACE\hkcuRunKeys.txt
wmic logicaldisk where "drivetype='4'" get deviceid,providername > C:\ProgramData\Dell\KACE\NetworkDrives.txt
exit

the users never see anything as long as the .bat file is there.  If you name it wrong they will get an error popup.


Comments:
  • I ran into cscript popping up that annoying black box the users call and think they are now hacked or have a virus.

    I found Wscript did not do this. The disadvantage of wscipt vs csript is if you have an error in your script the user gets a popup, so test, test ,test. - SMal.tmcc 10 years ago
  • So do I need to create the .bat file also as a dependency and reference it in the vbs script I am trying to run? - rchung 10 years ago
    • what are you trying to do in your vbs script, could you post it.

      If you use a bat file to do the work, upload both the vb script and the bat file as shown in the picture above
      To me it is easier to create batch files to do a lot of my tasks, then use the vb script to hide my batch file. If you are running a vbs that does it's work by itself, try using wscript instead of csript for the file to launch. - SMal.tmcc 10 years ago
      • I got it to work. Ran it as the wscript as suggested and it worked perfect! Thanks - rchung 10 years ago
      • The downfall if you have an error it pops a box to the user with wscript vs csript /c does not - SMal.tmcc 10 years ago
      • Bummer any way around it? What time of errors would you expect to happen? Thanks again for all the advice - rchung 10 years ago
      • yea just try if out on a few machines before breaking it loose. I had a popup when it could not find the bat file I was calling. another error I got with one vbscript telling ,me I had an incorrect parameter. So just trying them out a on few machines with different bit or os versions would be a good idea. - SMal.tmcc 10 years ago
    • Will do thanks. - rchung 10 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ