tag:blogger.com,1999:blog-8542235839869152787.post1581173660613574576..comments2022-12-04T20:52:28.775-08:00Comments on Invisible Denizen: Running commands as SYSTEM from VBA in Word or ExcelNathan Keltnerhttp://www.blogger.com/profile/08165445198675206275noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-8542235839869152787.post-9622610974751660682008-11-30T15:24:00.000-08:002008-11-30T15:24:00.000-08:00Anon,Sure. I have created a service on my machine...Anon,<BR/><BR/>Sure. I have created a service on my machine to launch a system shell whenever I happen to need one.<BR/><BR/>You create the service with:<BR/>C:\>sc create syscmd binpath= "%COMSPEC% /c start" type= own type= interact<BR/>[SC] CreateService SUCCESS<BR/><BR/>Then, whenever you need a system shell:<BR/><BR/>C:\>sc start syscmd<BR/>[SC] StartService FAILED 1053:<BR/><BR/>The service did not respond to the start or control request in a timely fashion.<BR/><BR/>... and a new SYSTEM level shell pops up on screen.Nathan Keltnerhttps://www.blogger.com/profile/08165445198675206275noreply@blogger.comtag:blogger.com,1999:blog-8542235839869152787.post-59589760355287607292008-11-27T07:19:00.000-08:002008-11-27T07:19:00.000-08:00Hi,brilliant code! Thank you!Question: is it possi...Hi,<BR/><BR/>brilliant code! Thank you!<BR/><BR/>Question: is it possible to stop the sequence of syscmds (0,1,...) and interact with the SYSTEM shell and close it afterwards with a combination of keyboard-strokes?<BR/><BR/>greetings from SwitzerlandAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8542235839869152787.post-13047454559397883502008-11-17T16:08:00.000-08:002008-11-17T16:08:00.000-08:00You can also do this with an unprotected scheduler...You can also do this with an unprotected scheduler:<BR/><BR/>for /f "usebackq tokens=9" %i in ( `at 1:00 /interactive c:\windows\system32\cmd.exe /k` ) do (<BR/>schtasks /run /tn at%i<BR/>at %i /d<BR/>)<BR/><BR/>(if you run this from a batch file, change %i to %%i)<BR/><BR/>This will cause a "superprompt" to appear (except on Vista, because Vista sucks)<BR/><BR/>On Vista, you can do the same thing using NetCat. Instead of a command prompt, execute:<BR/><BR/>nc -L -e c:\windows\system32\cmd.exe -p 1234<BR/><BR/>This will cause the scheduler to launch netcat, which will spawn a command prompt when you telnet to the machine on port 1234.<BR/><BR/>Have fun....<BR/><BR/>-JPJustin Parrhttps://www.blogger.com/profile/00463289461631527519noreply@blogger.com