Skip to content

How do I call a command line argument? #9

@hackdefendr

Description

@hackdefendr

I would like to do something like this, but currently this wrapper does not seem to accept sys.argv[1] to set variables. I tried with quotes and without quotes, the script just hangs. When I hard code the host variable, it works without issue.

import sys
import wmi_client_wrapper as wmi

wmic = wmi.WmiClientWrapper(
username="JIMBOB",
password="PASSWORD",
host="sys.argv[1]",
)

output = wmic.query("select FreeSpace from Win32_LogicalDisk where DeviceID='C:'")
print(output)

I even tried to use an input function to ask for host, but it doesn't like that either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions