I am writing my first VBScript in Win98 SE to do a simple software install. The first copy (CopyFolder) works just fine, but on the second copy (CopyFile) I get:
Windows Script Host
Line: 14
Error: Permission Denied
Code: 800A0046
Source: Microsoft VBScript runtime error
How do I fix this?
Here is the script:
-----------------------------------------------------------
<code>
' VB Script to install IrfanView on Drive C:
' Define variables
Dim fso, Irfan_folder, Irfan_ini, MyVar
Set fso = CreateObject("Scripting.FileSystemObject"
Set Irfan_folder = fso.GetFolder("\Irfanview"
Set Irfan_ini = fso.GetFile("\IrfanView\i_view32.ini"
' Copy IrfanView Folder to C:
fso.CopyFolder Irfan_folder, "C:\"
' Copy IrfanView .ini file to C:\Windows
fso.CopyFile "\IrfanView\IrfanView.lnk", "C:\Windows"
MyVar = MsgBox ("IrfanView Install is complete.",0,"Install Success!"
</code>
------------------------------------------------------------------------------------------
Thanks.
Windows Script Host
Line: 14
Error: Permission Denied
Code: 800A0046
Source: Microsoft VBScript runtime error
How do I fix this?
Here is the script:
-----------------------------------------------------------
<code>
' VB Script to install IrfanView on Drive C:
' Define variables
Dim fso, Irfan_folder, Irfan_ini, MyVar
Set fso = CreateObject("Scripting.FileSystemObject"
Set Irfan_folder = fso.GetFolder("\Irfanview"
Set Irfan_ini = fso.GetFile("\IrfanView\i_view32.ini"
' Copy IrfanView Folder to C:
fso.CopyFolder Irfan_folder, "C:\"
' Copy IrfanView .ini file to C:\Windows
fso.CopyFile "\IrfanView\IrfanView.lnk", "C:\Windows"
MyVar = MsgBox ("IrfanView Install is complete.",0,"Install Success!"
</code>
------------------------------------------------------------------------------------------
Thanks.