0
我在Ruby中寫入Windows帳戶報告。我有一個用戶名數組在Ruby中使用變量執行cmd命令失敗
users_local = [user1, user2, user3]
因爲我想執行一個cmd命令獲得每個用戶
system "net user '#{users_local[0]}'"
更多信息,每一個用戶,現在我得到
The user name could not be found.
More help is available by typing NET HELPMSG 2221.
當我直接執行 system 'user net user1'
該命令正確執行。爲什麼用變量執行命令失敗的任何想法?
就是這樣,謝謝。 – mila002