Jump to content

Tip for running WPI from network-share...


Recommended Posts

Could you please try this script (but don't forget to change the FINDSTR-command).

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

SET SHARE=
SET USERNAME=
SET PASSWORD=
IF NOT "%~1"=="" SET SHARE=%~1

IF "%SHARE%"=="" (
TITLE Running local WPI...
PUSHD "%~dp0"
CALL :RUN
POPD
) ELSE (
TITLE Running WPI from "!SHARE!"...
IF NOT "!PASSWORD!"=="" SET ARGUMENTS=!ARGUMENTS! "!PASSWORD!"
IF NOT "!USERNAME!"=="" SET ARGUMENTS=!ARGUMENTS! /USER:"!USERNAME!"
FOR /F "tokens=2" %%D IN ('NET USE * "!SHARE!" !ARGUMENTS!^|FINDSTR /I Laufwerk') DO SET DRIVELETTER=%%D
IF "!DRIVELETTER!"=="" (
PUSHD "!SHARE!"
) ELSE (
PUSHD "!DRIVELETTER!"
)
ECHO.Mounting "!SHARE!" to "!CD!"...
CALL :RUN
ECHO.Unmounting network-drive...
POPD
IF NOT "!DRIVELETTER!"=="" (
NET USE "!DRIVELETTER!" /DELETE
)
)

GOTO :END

:RUN
PUSHD WPI
ECHO.Starting WPI...
START /wait "%WINDIR%\mshta.exe" wpi.hta
PAUSE
POPD
GOTO :END

:END

Link to comment
Share on other sites


  • 3 weeks later...

New Version:

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

SET SHARE=
SET USERNAME=
SET PASSWORD=
SET HIDEWINDOW=no
IF NOT "%~1"=="" SET SHARE=%~1

IF "%SHARE%"=="" (
TITLE Running local WPI...
PUSHD "%~dp0"
CALL :RUN
POPD
) ELSE (
TITLE Running WPI from "!SHARE!"...
IF NOT "!USERNAME!"=="" IF "!PASSWORD!"=="" SET /P PASSWORD=Passwort fuer !USERNAME! @ !SHARE!:
IF NOT "!PASSWORD!"=="" SET ARGUMENTS=!ARGUMENTS! "!PASSWORD!"
IF NOT "!USERNAME!"=="" SET ARGUMENTS=!ARGUMENTS! /USER:"!USERNAME!"
SET ARGUMENTS=!ARGUMENTS! /PERSISTENT:YES
FOR /F "tokens=2" %%D IN ('NET USE * "!SHARE!" !ARGUMENTS!^|FINDSTR /I Laufwerk') DO SET DRIVELETTER=%%D
IF "!DRIVELETTER!"=="" (
PUSHD "!SHARE!"
) ELSE (
PUSHD "!DRIVELETTER!"
)
ECHO.Mounting "!SHARE!" to "!CD!"...
CALL :RUN
ECHO.Unmounting network-drive...
POPD
IF NOT "!DRIVELETTER!"=="" (
NET USE "!DRIVELETTER!" /DELETE
)
)

GOTO :END

:RUN
PUSHD WPI
ECHO.Starting WPI...
IF /I "%HIDEWINDOW%"=="yes" IF EXIST Tools\cmdow.exe Tools\cmdow.exe @ /HID
START /wait "%WINDIR%\mshta.exe" wpi.hta
POPD
GOTO :END

:END

Changes:

1. now it's possible to hide the command-window if cmdow.exe exists in WPI\Tools

2. share is mounted persistent (for restart-reasons)

3. username and password can set for password-protected shares

4. if only username is set the script will ask for password

users with a non-german Windows have to replace FINDSTR /I Laufwerk with FINDSTR /I ?????.

????? is the first word in the first line of the output of the net-user-command with your share.

This is my command with output:

net use * \\home\system
Laufwerk Z: ist jetzt mit \\home\system verbunden.

Der Befehl wurde erfolgreich ausgeführt.

Greetings

Al

Link to comment
Share on other sites

  • 2 months later...

I think you guys are making this more difficult then it is lol. Or maybe I just like my way better. Here's my two cents. Set WPI to use UNC (i.e. \\pcname\nero\install.exe or w/e). Use batch file to copy all files under wpi directory to local disk. use AutoIt to start the batch file and start wpi when done copying. after wpi has finished have it run another batch to delete wpi folder (if so desired) and then delete itself.

Link to comment
Share on other sites

I didn't know it was really that hard to run it from the network. I have the exact same versions on cd and the network. I just copyied it up there with the directory strucure, Unattended, which contains the wpi.ico and autorun, (truthfully this directory name doesn't matter) then wpi\all the normal stuff. Then when I want to use it I just map a local drive letter to \\server\unattended and the autorun in the unattended directory kicks off and the wpi behaves as if it were on a cd. If the autorun doesn't kick I just go hit the wpi.hta and it goes. Have yet to notice any issues.

Link to comment
Share on other sites

I think you guys are making this more difficult then it is lol. Or maybe I just like my way better. Here's my two cents. Set WPI to use UNC (i.e. \\pcname\nero\install.exe or w/e). Use batch file to copy all files under wpi directory to local disk. use AutoIt to start the batch file and start wpi when done copying. after wpi has finished have it run another batch to delete wpi folder (if so desired) and then delete itself.

I think the point was not to have to downlaod 2gigs of install files over the network. I am using the unc path example above to map a drive to my corp. install server where we keep all the apps we have to install. I dont want to have to download all the apps I install over the network just to install them.

With the unc path version I am able to add a shortcut to my Image and any machine that is imaged has a shortcut to WPI on our server, The desktop guys run the cmd to kick off the WPI and select thier programs and start. Way to fast and easy and I really wanted to thank everyone for all thier help.

Ben

Link to comment
Share on other sites

  • 3 weeks later...

After a couple of years im saying hello again! :hello:

I must say the WPI community and special the developer have done a great job..!!! :thumbup

Im trying to run WPI from Winpe 2 wich is freeware if used from WAIK...

1. Winpe2 its running in Ram after deployment from PXE-Linux Server...

2. WPI is working fine if i run it from Ramdrive...also all aplications are running fine...if they also stay in RAM

My biggest problem is i dont have enough RAM.... (Its also easier to update all thinks in the network share!!!)

So im trying to run WPI and al the other stuff from network...and because its not working im now here.....

I cant make run WPI from network share: Because the Winpe2 User "System" dont knows Driveletters like z:

at other side i cant use the method running wpi from %share% because i must (beacuse of security settings in Winpe2???) start wpi.hta with x:\windows\system32\mshta.exe %share%\wpi.hta ...but this works only partially i get the errors shown in attached files: ..after the last error i see only a blank "mshta" window.

I think there is (in my case) some problem with the wpipath variable... maybe the variable is not interpreted correctly in Winpe2??

My Question: Is there somebody out there who has running the combination WINPE2 and WPI with apllications from Network share? :unsure:

a lot of thanks for any answer!

post-25977-1191526118_thumb.jpg

post-25977-1191526137_thumb.jpg

post-25977-1191526150_thumb.jpg

post-25977-1191526160_thumb.jpg

post-25977-1191526170_thumb.jpg

post-25977-1191526182_thumb.jpg

Link to comment
Share on other sites

OK! You are making the right question!!! Why use WPI in preinstalation environment???

This same question i have made about 3 years before....well my question was: Why i cant select in an GUI in the first 5 minutes of contact with a n new PC all the components i want have installed onto the computer..????

WPI for me is more than

Windows (why not Linux)

Post (why not Pre...)

Instalation (why not other thinks like Virus Scan or Bios Update or Imaging with Imagex?? )

If i create some new scripts (like now unattend Application installs) i can make WPI most powerfull than ever!!!

Running from WInpe2 its possible to make in the first minute

  • rescue and antivirus operations on existent Installation of a PC

  • defining of wich operating system and applications will be installed (unattended WIndows script /unattended apllication scripts applied with imagex)

and and and...

ok all what in the year 2004 only was in my mind in this moment exists: File-based Imaging Solution!! and a powerfull GUI so that everbody can use it once configured... the end-user has only to know where to put the aplication and OS "source files"!!!

Ok ...the only problem is: How to make it work from a Network Ressource after booting also the Winpe2 from Network.... i hope the developers will take my comments as an suggestion for improvements ;)

Oh, and i have made some improvements regarding slimming down Winpe2.. at this moment im using an only 80MB "small" WinPE2 winpe.wim wich is working fine (if wpi is installed in this file)...

Link to comment
Share on other sites

ok fine...no replies... :(

well another question: Im getting "error on line102" (see my picture above) when i delete wbem folder... i think there is an unique WMI comannd elsewhere in scripts... who knows about it... i can close the error windows and everthing else works fine...

Please i need shortly some constructive feedback :)

Link to comment
Share on other sites

ok..i found the place in the sourcecode...

in core.js line 102 is detected the OSLanguage...

i comment out some lines and hardcoded my language

// var OSProps = GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem");

// Language ID in Dec

// sLang = new Enumerator(OSProps).item();

// Enum = sLang.OSLanguage;

// DtoH = DecToHex(Enum);

// while (DtoH.length<4)

DtoH = "300a";

Link to comment
Share on other sites

You know you can add WMI support to WinPE 2.0 and you won't get these errors. I haven't tried using WPI in PE, but I do use several other hta's and just as a rule of thumb I always add scripting and wmi support. You can add them to your PE image by using the peimg tool.

i.e.

peimg /install=*scripting* <pathtoPEmount>\Windows
peimg /install=*wmi* <pathtoPEmount>\Windows

Link to comment
Share on other sites

I simply have a runonce line to map my WPI share to the T:\, and then run T:\wpi.hta

All of my install paths have T:\ in them instead of %cdrom%, I haven't felt the need to go back and change them.

Hundreds of installs, no problems. (At least no problems when the file server is linux based).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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