Imsa
Imsa

Reputation: 1125

VBS Copy and Rename A File Error

I have a file downloaded to TEMP which needs to copied to Firefox directory. However, I keep getting this error.

Error: Bad file name or number`
Code: 800A0034

oFSO.MoveFile "C:\TEMP\Firefox\update.log", """C:\Program Files (x86)\Mozilla Firefox\uninstall\uninstall.update""" '// Rename file` 

I am using three set of quotes, because two wasn't working. Using two quotes gives the following error

Expected end of statement
Code: 800A401`

Upvotes: 0

Views: 148

Answers (2)

Lews Therin
Lews Therin

Reputation: 3777

Your problem is the use of """. The destination location doesn't need to have escaped " characters around it.

If you change it to the following, I've tested and confirmed it works:

oFSO.MoveFile "C:\TEMP\Firefox\update.log", "C:\Program Files (x86)\Mozilla Firefox\uninstall\uninstall.update"

Upvotes: 1

2174714
2174714

Reputation: 288

try the old 8.3 naming convention

oFSO.MoveFile "C:\TEMP\Firefox\update.log", "C:\Progra~1\Mozill~1\uninstall\uninstall.update" '// Rename file

Upvotes: 0

Related Questions