vbscript - can someone check my coding here pls -


this vbscript should random number between 1 , 3, , type letter according number , type notepad opened , goto next line, reason doesn't enter letter. can explain problem me please? here code:

set ws = createobject("wscript.shell") ws.run "notepad.exe" wscript.sleep 100   rand = int((3 - 1 + 1) * rnd + 1)  if rand=1     key = elseif rand=2     key = b elseif rand=3     key = c end if  ws.sendkeys key ws.sendkeys "{enter}" wscript.sleep 1000  loop 

key="a" 

place option explicit first line of file , see trying assign non defined variables instead of string literals


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -