I am wanting to include the variable domainUser within the quoted command sent to the commandline but I am not having any luck. What I am trying to accomplish is to create a log file titled with their domain name but I keep getting errors or just getting a txt file with no title.
Dim domainUser
domainUser = Example123
objInParam.Properties_.Item("CommandLine") = "cmd /c ECHO Test >> c:\UserLogs\"""domainUser""".txt"
So line 4 would be read like this (or whatever domain user I put in on line 2)...
objInParam.Properties_.Item("CommandLine") = "cmd /c ECHO Test >> c:\UserLogs\Example123.txt"
You need concatenation to splice a variable's content into a string and double double quotes to put double quotes into it: