I have the attached script that I need some help with. It was created for a linked clone and will not work with a dedicated VM. What is does is when the thinapp is first ran it will create a folder on the D drive and copy a file into the folder. I'm asking for some help to create a folder on the C drive and copy the file into the same folder.
Looking at the script, i think it copies the file to C:\VAForms5. Not very sure why it is going to D drive.
That was it! Thank you for explaining how it worked. I appreciate it.
I tried adding Function OnFirstSandboxOwner to the top of the script and I am getting errors now. I found out that the script would run everytime and erase the database that was in the folder on the C drive. Any idea how to get the script attached to run correctly? Thanks in advance.
Can you attach the script?
Use of wscript commands are not supported in ThinApp VBscripting.
I can understand that but why does it run and do what I want it to do? I just need it to only run once instead of everytime the user opens the thinapp.
See if this helps.
You may change the messages in message boxes like what you need.
-GURU
Exactly what I was looking for. Just one favor, can you please remove the message boxes? They popup everytime I run the thinapp and the users will not want to click on several times before the application finally opens. A BIG thank you!!
I received an error the second time that the file already exists. It says line 39, character 2.
Replace this line in the script
filesys.CopyFile "c:\vvet5.mdb"
with
filesys.CopyFile "c:\vvet5.mdb", strFolder,true
this will overwrite even if the file is existing
GURU
If the file is there I don't want it over written. Any new user that starts with the department needs to have the blank database and they add to it. For current users we are taking the database from their desktop and copying it to the virtual comptuer. A lot of users have many years of data in the database and it cannot be over written. The only reason that this is being done this way is so that the user can see the folder on the drive and replace the current database with the one that they pull off of their other computer. They also need to backup this database from time to time. Hope that helps you.
The below script works fine. I just need help removing the message boxes that appear. I was able to remove every message box except for the below section.
msgbox "copying c:\vvet.mdb to " & strFolder
filesys.CopyFile "c:\vvet5.mdb", strFolder
dim filesys
strDrive = "C:\"
strFolder = strDrive & "VAForms5" & "\"
sub CreateFolder
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(strFolder) Then
Set newfolder = filesys.CreateFolder(strFolder)
MsgBox "A New Folder is created successfully"
End If
End Sub
Sub CopyFile
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("c:\vvet5.mdb") Then
MsgBox "File exists"
msgbox "copying c:\vvet.mdb to " & strFolder
filesys.CopyFile "c:\vvet5.mdb", strFolder
else
msgbox "The very required access database folder in c:\ by name vvet5.mdb is not found"
End If
End Sub
Function OnFirstSandboxOwner
msgbox "This application is for VMware Employee only!"
CreateFolder
CopyFile
End Function
Just delete that line or comment out by adding ' at the beginning.
'msgbox "copying c:\vvet.mdb to " & strFolder
wow, that was all that I had to do. I was thinking too deep on that one. Thank you again for both of your help! Now this application can be deployed to Windows 7 users where as before it was only being used for XP only users.