I have a problem in VBScript. I get an error when I run this script. It says ‘path not found’.
<SCRIPT Language="VBScript">
Option Explicit
dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
If not filesys.FileExists("%USERPROFILE%\CAD_Kunde\CAD_Kunde.txt") Then
Set filetxt = filesys.OpenTextFile("%USERPROFILE%\CAD_Kunde\CAD_Kunde.txt", ForWriting, True)
filetxt.WriteLine ("1")
filetxt.Close
End If
</script>
Steps to approach this problem. (I could give the solution in a oneliner, but what is the
funlearning in that?)Set WShell = CreateObject("Wscript.Shell")