hi,
i have this script to take input from a user:
dim fso, wshshl, fil,oShell, strExec, fullname
dim txtFile
set wshshl = wscript.createobject("wscript.shell"
set fso = createobject("Scripting.FileSystemObject"
set oShell=Wscript.CreateObject("Wscript.Shell"
fullname = inputbox("Enter in Full Name to be assigned to Client", "Fullname"
Set txtFile = fs
penTextFile("c:\a.xt", 2, True)
'Change 2 to 8 if you want to append to file
txtFile.WriteLine "Name = " & fullname
txtFile.Close
My problem is that when a user enters in spaces between the name, i.e, john doe
the output that is written to a.txt is: john doe
However, I need to insert quotes around the john doe, like "john doe" on the txt file because it is being read by another
program, and it needs quotes around the variable otherwise it will be truncated with just "john".
I pretty sure this is simple, but i'm just learning vb script, so i'm wondering if anyone can help.
thanks,
i have this script to take input from a user:
dim fso, wshshl, fil,oShell, strExec, fullname
dim txtFile
set wshshl = wscript.createobject("wscript.shell"
set fso = createobject("Scripting.FileSystemObject"
set oShell=Wscript.CreateObject("Wscript.Shell"
fullname = inputbox("Enter in Full Name to be assigned to Client", "Fullname"
Set txtFile = fs
'Change 2 to 8 if you want to append to file
txtFile.WriteLine "Name = " & fullname
txtFile.Close
My problem is that when a user enters in spaces between the name, i.e, john doe
the output that is written to a.txt is: john doe
However, I need to insert quotes around the john doe, like "john doe" on the txt file because it is being read by another
program, and it needs quotes around the variable otherwise it will be truncated with just "john".
I pretty sure this is simple, but i'm just learning vb script, so i'm wondering if anyone can help.
thanks,