Jump to content

Visual Basic Script Help


Recommended Posts

Hi guys,

We use a boot cd with winpe to launch a vbs script and load data from another dvd. Now we have some machines that don't come with dvdrom drives, older optiplex 520s and so on. No I've managed to get the script that it loads.

Here it is:

wscript.sleep(2000)
set objscripting = wscript.createobject("wscript.shell")
set FSO = createobject ("scripting.filesystemobject")
set coldrives = FSO.drives
for each objdrive in coldrives
if objdrive.drivetype=4 then
driveletter=objdrive.driveletter
answer=MsgBox("Would you like to install the image?",4,"Image install")
if answer = 6 then

wscript.echo("Enter the Imaging DVD into the "&objdrive&" drive")
objscripting.run("cmd /c start rdeployt -md -f "&driveletter&":\image.exe")
end if
end if
next

Is it possible to edit the code so it loads from a portable harddrive and not a dvdrom? As far as I've googled, changing:

if objdrive.drivetype=4 then

to

if objdrive.drivetype=1 then

should do it. Am I correct? Is there other changes to the script that would be needed?

Link to comment
Share on other sites

  • 2 months later...

What exactly are you trying to copy between the machines and how often does this data copying occurs? I am not 100% sure what you are trying to do? Could you please be more specific so I can help you with your query.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...