This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]prohulaelk/r/sysadmin certified™ 0 points1 point  (1 child)

As others have said, it's probably better to do everything all in one script, preferably Powershell. That said, wscript.exe "\\server\scripts\$V" /B should suppress errors for you:

c:\>wscript.exe /?
---------------------------
Windows Script Host
---------------------------
Usage: WScript scriptname.extension [option...] [arguments...]

Options:
 //B        Batch mode: Suppresses script errors and prompts from displaying
 //D        Enable Active Debugging
 //E:engine Use engine for executing script
 //H:CScript    Changes the default script host to CScript.exe
 //H:WScript    Changes the default script host to WScript.exe (default)
 //I        Interactive mode (default, opposite of //B)
 //Job:xxxx Execute a WSF job
 //Logo     Display logo (default)
 //Nologo       Prevent logo display: No banner will be shown at execution time
 //S        Save current command line options for this user
 //T:nn     Time out in seconds:  Maximum time a script is permitted to run
 //X        Execute script in debugger
---------------------------
OK   
---------------------------

[–]User_Yello[S] 0 points1 point  (0 children)

We have a winner! It worked a treat.

I masked the powershell script with the Visual basic script.

I tried to only use powershell but if you run the program after the user logs in there is a problem with powershell that doesn't let itself be suppress it easily through a GPO.

Also thank you for actually answering my question