Move Failed (2) - Need help using createfile to run VBS

(imported topic written by squizzi91)

I read up on using createfile/appendfile to create a file and then copy/move it to make it into a valid .vbs file and then using BigFix to run that file. However, I’ve been having issues using the copy/move commands to allow this to happen, each command normally errors out with Copy failed (0) or Move failed (2). I’m just starting out with Fixlet Authoring, so if its something small I apologize.

Here’s what I have:

createfile until __End

Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = “.”

Set objRegistry = GetObject(“winmgmts:\” & strComputer & “\root\default:StdRegProv”)

strKeyPath = “SOFTWARE\Classes\mailto\shell\open\command”

strValueName = “”

strValue = " C:\Program Files\IBM\Lotus\Notes\notes.exe -basic -defini “”%1"" "

objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue

__End

move __createfile “defaultmail.vbs”

waithidden “C:\WINDOWS\system32\wscript.exe” defaultmail.vbs

delete __createfile

This vbs edits the registry file - I know I can edit/add registry files in BigFix - but this edits the default key which I had issues figuring out how to do inside a .reg file, a batch file, etc, so I decided to use VBS. The script works great, I just need to know how to set it up in BigFix to push to my boxes.

Thanks in advance.

(imported comment written by SystemAdmin)

delete __createfile

createfile until endoffile

Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = “.”

Set objRegistry = GetObject(“winmgmts:\” & strComputer & “\root\default:StdRegProv”)

strKeyPath = “SOFTWARE\Classes\mailto\shell\open\command”

strValueName = “”

strValue = " C:\Program Files\IBM\Lotus\Notes\notes.exe -basic -defini “”%1"" "

objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue

endoffile

DOS MOVE __createfile __Download\defaultmail.vbs

waithidden “{pathname of system folder}\wscript.exe” __Download\defaultmail.vbs

(imported comment written by SystemAdmin)

you can also do something like this… much less typing

regset “HKLM\SOFTWARE\Classes\mailto\shell\open\command” @ = "C:\Program Files\IBM\Lotus\Notes\notes.exe -basic -defini “%1” "

(imported comment written by squizzi91)

Thanks alot for the help - I wasn’t sure you could do Default keys in BigFix; originally this was meant to be a vbscript anyways and then we decided to just push it to everyone in BigFix.

(imported comment written by SystemAdmin)

you may have to specify 64bit here…

if{x64 of operating system}

regset64 “HKLM\SOFTWARE\Classes\mailto\shell\open\command” @ = "C:\Program Files\IBM\Lotus\Notes\notes.exe -basic -defini “%1” "

else

regset “HKLM\SOFTWARE\Classes\mailto\shell\open\command” @ = "C:\Program Files\IBM\Lotus\Notes\notes.exe -basic -defini “%1” "

endif

you’ll have to test that