Good morning, I have the following script.
Set oShell = CreateObject("WScript.Shell")
strValue = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device"
strPrinter = oShell.RegRead(strValue)
strPrinter = Split(strPrinter, ",")(0)
I would like to create a file .txt
with the name of the variable strPrinter
.
I use BGinfo
to tell which default printer it has server\modelo\ip
.
It would be interesting to just bring the name of the printer, so I'm going to generate a txt file and use the filename as reference for printer information.
How to create a txt file with variable name? I can also solve by putting the information inside the txt file. For example, creating a file named "Printer.txt"