WSHShell CMD open silently?

DayzerDayzer Member Posts: 12
Hi Guys/Gals,

I am looking to running a few scripts silently with CMD.

I want CMD to run in the background.

Currently it opens the black promot screen while its working.

Is there a way to hide it?
IF CONFIRM('Do you want to Query Service?') THEN BEGIN
IF ISCLEAR(wsh) THEN
 CREATE(wsh);
  wsh.Run('cmd.exe /c SC \\'+"Server Name"+' Query '+"Distribution Server"+' > C:/Temp/query.txt');
SLEEP(3000);
wsh.Run('cmd.exe /c findstr "SERVICE_NAME STATE" C:\temp\query.txt >C:/Temp/Service_Query.txt');
SLEEP(3000);
TxtFile.OPEN('c:\Temp\Service_Query.txt');
TxtFile.CREATEINSTREAM(StreamIn);
WHILE NOT StreamIn.EOS DO BEGIN
  StreamIn.READTEXT(Buffer);
   //Do some processing.
   MESSAGE('Stream Reading: %1', Buffer);
END;
TxtFile.CLOSE;
END;

Comments

Sign In or Register to comment.