Jump to content

jhn_bengtsson

Member
  • Posts

    3
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Sweden

About jhn_bengtsson

jhn_bengtsson's Achievements

0

Reputation

  1. Hi.. I manage to complete the script and this is it. This installation is either to a laptop or a desktop thats why i use temp1.txt or temp2.txt to locate witch installation that needs to be installed.. All scripts exists on a CD at the begining, and the user only needs to puch one buttom And the first script is for desktop users.. bind with a buttom on the cd_startmenu Set objFSO = CreateObject("Scripting.FileSystemObject") Set objShell = WScript.CreateObject("WScript.Shell") Set Reg = CreateObject("wscript.shell") Dim objFSO Dim objShell Dim Reg If objFSO.FolderExists("C:\Program Files\F-Secure")Then Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUNONCE\" & "cd", "C:\" & "runcd" & ".vbs" objShell.Run("uninstall.exe /S") objFSO.CreateTextFile("C:\Temp1.txt") Set objFileCopy = objFSO.GetFile("runcd.vbs") objFileCopy.Copy ("C:\runcd.vbs") Else objShell.Run("ILAUNCHR.EXE jar\install_desktop.jar /U /C") End If This is the script that the erlier script puts out to C:\.. Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject") Dim Act : Set Act = WScript.CreateObject("Wscript.Shell") Dim Drv, StrD, Drive Set Drv = Fso.Drives For Each StrD In Drv If StrD.DriveType = 4 Then If StrD.IsReady = True Then If Fso.FileExists(StrD & "\runcd.vbs") Then Set Drive = StrD If Fso.FileExists("C:\Temp1.txt") Then Act.Run(StrD & "\ILAUNCHR.EXE " & StrD & "\jar\install_desktop.jar /C /U") Fso.DeleteFile("C:\Temp1.txt") End If If Fso.FileExists("C:\Temp2.txt") Then Act.run(StrD & "\ILAUNCHR.EXE´" & StrD & "\jar\install_laptop.jar /C /U") Fso.DeleteFile("C:\Temp2.txt") End If End If End If End If Next Set Drv = Fso.Drives For Each StrD In Drv If StrD.DriveType = 4 Then If StrD.IsReady = True Then Set Drive = StrD Act.Run(StrD & "\cleanup.vbs") End If End If Next And this script is the cleanup.vbs Dim Fso Set Fso = CreateObject("Scripting.FileSystemObject") Do Until i = IsReady i = ("C:\runcd.vbs") Loop Fso.DeleteFile("C:\runcd.vbs"), True Well thats it folks.. thx for the help gunsmokingman B) And yes im not the perfect man on this job but i did it, and there is some lines that i dont need at all.. but i will keep it there Its working and Im happy B)
  2. How can I get runonce to see if "drive check" loading is complete? And the file exists, its on my cd I dont know if thats the problem, I think its my script to call the cd..
  3. Hi! I have created following: Dim Reg Set Reg = CreateObject("wscript.shell") Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUNONCE\" & "NAME", "PATH" & "\" & "NAME" & ".vbs" With that .vbs file I want to run a .bat on a cdrom at startup in windows, is that possible? The problem is that I can not be sure that the CDrom drives "path" is the same all the time so I need a loop untill the script finds the right path, please help me!! And if its possible to do that, how can the script understand that the cd drive is mounted at the startup, if the cdrom drive is not "mounted" then the script wont run. I know I can use Wscipt.sleep but will that work? I have tried Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.DriveExists("D:\") Then objShell.Run("D:\Name.bat") ElseIf objFSO.DriveExists("E:\") Then objShell.Run("E:\Name.bat") 'and so on and so on End If But it wont go, please help me
×
×
  • Create New...