Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Prevent command window from closing when executed from and HTA

$
0
0
The below line of code executes just fine, however, I would like to keep the command window open to see the result (i.e. if running a batch file, I'd simply add 'Pause" to the end and get "Press and key to continue...). This is only an example, not looking to justify shelling out to run PSEXEC for a REG function, but to get the output displayed like you would in a batch file.
	SUB SCRemoval
		DIM objShell
		SET objShell=CreateObject("WScript.Shell")
		objShell.Run ("c:\utilities\psexec.exe \\" & strComputer & " reg add " & """HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"" /v scremoveoption /t REG_DWORD /d 0 /f")
	END SUB






Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>