I have a file (launch.vbs) on my memory stick which copies start.vbs (a file from my memory stick) into "C:\Docs\" when run. I then want launch.vbs to execute start.vbs when its in the C drive (i.e. execute "C:\Docs\start.vbs") and it does so, however start.vbs has a line inside it to create a txt ("C:\Docs\output.txt"). The line is
SET creator = fso.CreateTextFile(CurrentDirectory & "\\output.txt",True)"
However when start.vbs is launched from launch.vbs this line gives me error code 800a0046 (Permission Denied). the fso.FileExists function also returns -1 when checking for files at that location if launch.vbs executed start.vbs. I assume this is because when I run launch.vbs I am only giving it low-level permissions and so start.vbs is run with those permissions which prevents it editing the C drive (however this is strange as launch.vbs managed to copy start.vbs to the C drive fine).
As a side note when I run start.vbs from the C drive (i.e. if launch.vbs copies it and then I manually run it) it works fine, it only goes wrong when I try to automatically run it. So to fix it I assume I need to run launch.vbs with more permissions, however is there a way to get it to do that automatically or even prompt for permissions (I know I could probably do right-click>run as admin but I want it to be automated more)
I do not want any admin prompts to pop up, this occurs if I try to elevate it using runas , remember I do not need to elevate the second script to admin status, merely the same status as the first script.