Log into VBScript

0

I need to create a log to see who used my script, and this log has to go to a txt.

Here is the procedure, how do I create this log that contains the user and the date

On Error Resume Next

Dim errorLevel

Set WSHShell = CreateObject("WScript.Shell")
Set WshNetwork = CreateObject("WScript.Network")


VAR1 = InputBox ("Informe o nome da impressora", "Mapeamento de impressora", "Escreva o nome da impressora")

resp = MsgBox("Favor aguardar 5 minutos para finalizar o processo de mapeamento", vbokonly + vbInformationtisdesk, "Mapeamento de impressora")

WshNetwork.AddWindowsPrinterConnection "\BRU02\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\CNO03\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\CPZ05\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\CTV02\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\CWBPS01BRF\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\EBU04\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\EBU16\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\HOR137\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\HORXPS01BRF\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\HORXPS02BRF\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\HORXPS03BRF\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\IAI03\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\IAI19\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\IAI22\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\MNE02\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\MRU03\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\NVM02\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\RVE06\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\RVE10\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\RVE11\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\SEC02\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\SPO37\"+VAR1,true
WshNetwork.AddWindowsPrinterConnection "\VDA16\"+VAR1,true


resp = MsgBox("    Por gentileza verificar se a impressora foi mapeada."& vbCrLf &"Caso nao tenha sido, favor entrar em contato com Help Desk de TI", vbokonly + vbInformationtisdesk, "Mapeamento de impressora")

WshShell.run("control printers")

I'm waiting.

    
asked by anonymous 01.09.2015 / 20:50

0 answers