big_orneau Posted October 18, 2007 Share Posted October 18, 2007 i use this one :@ECHO onnet use W: \\172.20.5.251\partage /PERSISTENT:NOREM Set the variables for the sharename and the application directorySET wpipath=WPISET drvlet=W:REM Write the app-path to the regsitryREG ADD HKLM\SOFTWARE\WPI /v SWPATH /t REG_EXPAND_SZ /d "%drvlet%" /fREM Determine the WPI startup path.SET wpipath=%drvlet%\%wpipath%REM Font installation - the smooth and customizable way.start "" /wait "%wpipath%\Tools\fonts\fontinstaller.exe"REM Force resolution to needed size for wpi interface.REM start "" /wait "%wpipath%\Tools\VideoChanger.exe 1024x768x32@85 -q"REM Special registry tweak needed.regedit /s "%wpipath%\common\wpi.reg"REM Make WPI directory the current directory.for /f "delims=: tokens=1" %%i in ("%wpipath%") do %%i:cd "%wpipath%"REM Start WPI and wait for its endstart /wait WPI.htaREM Delete the Key out of the registryREG DELETE HKLM\Software\WPI /fendlocal&goto :eof Link to comment Share on other sites More sharing options...
GrowBigTrees Posted April 12, 2008 Share Posted April 12, 2008 (edited) I adapted AlBundy33's nice cmdfile on these points:Laufwerk should no longer be changed to your localized "Drive" or whatever, as the script looks now for the ":" after the driveletter you can use WPI parameters when calling the cmdfile, as in WPI.cmd "OFFICE" "12" "SERVERWPI" "SERVERUser" "User'sPassword" disabled "Open File Security" Warning when running applications@ECHO OFF::V5 2008-04-14 - WPI.CMD: launch WPI.hta from network or local::see http://www.msfn.org/board/lofiversion/index.php/t76693.htmlSETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSIONSET WPICONFIG=SET WPICOUNTDOWN=SET SHARE=SET USERNAME=SET PASSWORD=::to disable "Open File Security Warning" when running applications - see http://www.pcreview.co.uk/forums/thread-175517.phpSET SEE_MASK_NOZONECHECKS=1:: or you can use this: (see http://www.msfn.org/board/lofiversion/index.php/t76693.html):: SET "KEYD=HKCU\Software\Microsoft\Internet Explorer\Download":: SET "KEYP=HKCU\Software\Microsoft\Windows\CurrentVersion\Policies":: REG add "%KEYD%" /v "CheckExeSignatures" /d "no" /f:: REG add "%KEYD%" /v "RunInvalidSignatures" /t "REG_DWORD" /d 1 /f:: REG add "%KEYP%\Attachments" /v "SaveZoneInformation" /t "REG_DWORD" /d 1 /f:: REG add "%KEYP%\Associations" /v "LowRiskFileTypes" /d ".cmd;.exe;.hta;" /fSET HIDEWINDOW=yesIF NOT "%~1"=="" SET WPICONFIG=%~1&& echo parameter 1 = WPIconfig: "!WPICONFIG!"IF NOT "%~2"=="" SET WPICOUNTDOWN=%~2&& echo parameter 2 = WPICOUNTDOWN : "!WPICOUNTDOWN!"IF NOT "%~3"=="" SET SHARE=%~3&& echo parameter 3 = SHARE to install from: "!SHARE!"IF NOT "%~4"=="" SET USERNAME=%~4&& echo parameter 4 = USERNAME for mounting SHARE: "!USERNAME!"IF NOT "%~5"=="" SET PASSWORD=%~5&& = echo parameter 5 = PASSWORD for mounting SHARE: "!PASSWORD!"ECHO.IF "%SHARE%"=="" ( TITLE Running local WPI... echo Running local WPI from "%~dp0" ... PUSHD "%~dp0" CALL :RUN POPD) ELSE ( TITLE Running WPI from "!SHARE!"... IF NOT "!USERNAME!"=="" IF "!PASSWORD!"=="" SET /P PASSWORD=give PASSWORD for !USERNAME! @ !SHARE!: IF NOT "!PASSWORD!"=="" SET ARGUMENTS=!ARGUMENTS! "!PASSWORD!" IF NOT "!USERNAME!"=="" SET ARGUMENTS=!ARGUMENTS! /USER:"!USERNAME!" SET ARGUMENTS=!ARGUMENTS! /PERSISTENT:YES ::Look in the message when networkdrive mounted for the colon : after the localized Drive X: mounted or Laufwerk X: mounted or Station X: mounted : FOR /F "tokens=2" %%D IN ('NET USE * "!SHARE!" !ARGUMENTS!^|FINDSTR /I :') DO SET DRIVELETTER=%%D IF "!DRIVELETTER!"=="" ( PUSHD "!SHARE!" echo pushD the share "!SHARE!" because "!DRIVELETTER!" not found ... ) ELSE ( PUSHD "!DRIVELETTER!" ) ECHO.Running WPI from "!SHARE!" mounted to "!CD!"... CALL :RUN ECHO.Unmounting network-drive !CD!... POPD IF NOT "!DRIVELETTER!"=="" NET USE "!DRIVELETTER!" /DELETE /YES)GOTO :END:RUN ECHO.Starting WPI... IF /I "%HIDEWINDOW%"=="yes" IF EXIST Tools\cmdow.exe Tools\cmdow.exe @ /HID START /wait "%WINDIR%\mshta.exe" wpi.hta %WPICONFIG% %WPICOUNTDOWN% GOTO :END:END Edited April 14, 2008 by GrowBigTrees Link to comment Share on other sites More sharing options...
Iskander Novena Posted July 18, 2008 Share Posted July 18, 2008 Don't know if anybody still follows this thread or has alerts set or something..You all use "NET USE * <SHARE> /USER:<user>" or "NET USE <SHARE> <DRIVELETTER> /USER:<user>" and do stuff to figure out what driveletter was used...Did you know: when you use "NET USE <SHARE> /USER:<USER>" you don't get a drive-letter assigned for that UNC, but you CAN access it using the UNC-path?So suppose I have a UNC which I have to have specific credentials for that's named \\Server\WPI.I could easily connect to that in the following way:NET USE \\Server\WPI /USER:install install<do stuff>NET USE \\Server\WPI /deleteThis way, I connect to the UNC with user install and password install, do some stuff and then disconnect again.... Link to comment Share on other sites More sharing options...
mritter Posted July 20, 2008 Share Posted July 20, 2008 @TheFastOne:Avoid WMI error messageSee if this helps any. I have not tested it myself. Link to comment Share on other sites More sharing options...
SlonSoft Posted October 18, 2008 Share Posted October 18, 2008 Please Give a run through the WPI http? Sorry for my English Link to comment Share on other sites More sharing options...
chaoticyeshua Posted December 9, 2008 Share Posted December 9, 2008 (edited) I am by NO MEANS a good coder. In fact I'd go as far as to say I suck. But I absolutely love AutoIT, as it is extremely powerful, and I decided to write a version of this script in it.This is what works for me. Feel free to add/change things as you guys see fit, and clean it up some if you'd like. It actually works quite a bit faster than the cmd file. Please note my comments, especially the ones at the top of the script.Just copy and paste the code into SciTE and compile it once you're done editing.;This script can run either one folder up from WPI.hta directly from the share itself or from another location if you specify the share.;The directory structure must be like this: SomePath\SomeFolder\WPI\ where WPI.hta is in the WPI folder and this script is either in SomeFolder OR;a share is specified with SomeFolder shared (as in, the share path would look like \\server\share\WPI with WPI.hta in the WPI folder)AutoItSetOption("TrayIconHide",1);Change these values to suit your needs. You can also get rid of the If/ElseIf statements in the CallWPI function if you just use one config.Global $CONFIG1="CONFIGXP.JS"Global $CONFIG2="CONFIGVISTA.JS"Global $USERNAME=""Global $PASSWORD=""Global $SHARE="";Global variables needed for the rest of the program... DON'T CHANGE THESE VALUES.Global $IEDebWritten=falseGlobal $DebWritten=falseGlobal $DRIVE=""EnvSet("SEE_MASK_NOZONECHECKS",1)SetDrive()SetDebugger()CallWPI()ResetDebugger()UnmapDrive()EnvSet("SEE_MASK_NOZONECHECKS")ExitFunc SetDrive() $trimmedpath=StringTrimRight(@ScriptDir,StringLen(@ScriptDir)-2) If StringLen($SHARE)=0 Then If $trimmedpath="\\" and $USERNAME="" Then $DRIVE=DriveMapAdd("*",@ScriptDir,8) ElseIf $trimmedpath="\\" and StringLen($USERNAME)>0 Then $DRIVE=DriveMapAdd("*",@ScriptDir,8,$USERNAME,$PASSWORD) ElseIf FileExists($trimmedpath & "\WPI.exe") Then $DRIVE=$trimmedpath Else $DRIVE=@ScriptDir EndIf ElseIf StringLen($SHARE)>0 and $USERNAME="" Then $DRIVE=DriveMapAdd("*",$SHARE,8) ElseIf StringLen($SHARE)>0 and StringLen($USERNAME)>0 Then $DRIVE=DriveMapAdd("*",$SHARE,8,$USERNAME,$PASSWORD) EndIfEndFuncFunc SetDebugger() $IEDebValue=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "DisableScriptDebuggerIE") If $IEDebValue="yes" Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "DisableScriptDebuggerIE", "REG_SZ", "no") $IEDebWritten=true ElseIf @error Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "DisableScriptDebuggerIE", "REG_SZ", "no") EndIf $DebValue=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Disable Script Debugger") If $DebValue="yes" Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Disable Script Debugger", "REG_SZ", "no") $DebWritten=true ElseIf @error Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Disable Script Debugger", "REG_SZ", "no") EndIfEndFuncFunc CallWPI() If @OSVersion<>"WIN_Vista" Then RunWait(@SystemDir & "\mshta.exe " & '"' & $DRIVE & "\WPI\WPI.hta" & '"' & " config=" & '"' & $DRIVE & "\WPI\WPIScripts\" & $CONFIG1 & '"',"") ElseIf @OSVersion="WIN_Vista" Then RunWait(@SystemDir & "\mshta.exe " & '"' & $DRIVE & "\WPI\WPI.hta" & '"' & " config=" & '"' & $DRIVE & "\WPI\WPIScripts\" & $CONFIG2 & '"',"") EndIfEndFuncFunc ResetDebugger() If $IEDebWritten=true Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "DisableScriptDebuggerIE", "REG_SZ", "yes") EndIf If $DebWritten=true Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Disable Script Debugger", "REG_SZ", "yes") EndIfEndFuncFunc UnmapDrive() If DriveMapGet($DRIVE)=@ScriptDir or DriveMapGet($DRIVE)=$SHARE Then DriveMapDel($DRIVE) EndIfEndFunc Edited January 5, 2009 by chaoticyeshua Link to comment Share on other sites More sharing options...
03rst Posted June 26, 2009 Share Posted June 26, 2009 I hope someone can help with the issue I'm currently having with my network WPI repository. I've been running up to version 7.3 of WPI from my network source without issue. I recently upgraded to 7.5 and I'm having the following problem. My UI runs a batch file that inserts a run once regkey to execute a cmd file (from this topic) to launch WPI at next login. The cmd executes and the WPI window appears briefly then disappears. Once the desktop loads, I'm able to launch the cmd file again and WPI loads and runs without issue. My cmd file has not changed in over a year, but the jump from 7.3 to 7.5 seems to bring this issue with it.Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
mritter Posted June 27, 2009 Share Posted June 27, 2009 It probably has to do with the Office reg key issue. Search for that thread for details.I have made this an option in 7.6.0, which will be released July 1st. It should fix your problem. Link to comment Share on other sites More sharing options...
03rst Posted June 29, 2009 Share Posted June 29, 2009 Thanks mritter. I'll hold out until 7.6.0 Link to comment Share on other sites More sharing options...
djbazo Posted August 27, 2010 Share Posted August 27, 2010 (edited) Hello all,I try to Install Windows 7 Prof. via DVD and want to get WPI Installation over NetworkI added and modified "setupcomplete.cmd" to "sources\$oem$\$$\setup\scripts" on the Windows 7 DVD.Windows installs fine, then it comes the first start - "preparing for first use" and "checking video performance" and then it freeze.here is my "setupcomplete.cmd":reg add "HKLM\System\CurrentControlSet\Control\Network\NetworkLocationWizard" /v HideWizard /t REG_DWORD /d 00000001 /fnet use Z: \\192.168.x.xxx\DEPLOYStart z:\WPI\wpi.exeI tried also to connect via Net Use with Username and Password, but no change - same freeze.When i run WPI from DVD with the following "setupcomlete.cmd" it works fine.for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:reg add "HKLM\System\CurrentControlSet\Control\Network\NetworkLocationWizard" /v HideWizard /t REG_DWORD /d 00000001 /fStart %cdrom%\WPI\wpi.exedel %0Thanks for your help Edited August 27, 2010 by djbazo Link to comment Share on other sites More sharing options...
AlBundy33 Posted August 27, 2010 Author Share Posted August 27, 2010 Maybe your network is not setup correctly?you can try this:REM reg add "HKLM\System\CurrentControlSet\Control\Network\NetworkLocationWizard" /v HideWizard /t REG_DWORD /d 00000001 /fREM create automatically a networkdrive (works only if the share is not password-protected)PUSHD \\192.168.x.xxx\DEPLOYREM Start WPI and wait until it was closedStart "running WPI..." /Wait WPI\wpi.exeREM removes the networkdrivePOPDAttention: If WPI restarts your PC the network-drive is lost.Al Link to comment Share on other sites More sharing options...
djbazo Posted August 30, 2010 Share Posted August 30, 2010 Hi Al,thanks for your reply - i tried it with your syntax but it doesnt work - still the same issueWindows installs fine, then it comes the first start - "preparing for first use" and "checking video performance" and then it freeze.after i step over with ALT + F4 windows loads but it seems that setupcomplete.cmd doesnt run. Link to comment Share on other sites More sharing options...
djbazo Posted September 1, 2010 Share Posted September 1, 2010 Hey Al,I solved it with the following config:setupcomplete.cmdfor %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:copy %cdrom%\WPI\WPIRUN.cmd "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" /Ydel %0WPIRUN.cmdfor %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\sources\install.wim set CDROM=%%i:REG add "HKCU\Software\Microsoft\Internet Explorer\Download" /v "CheckExeSignatures" /d "no" /fREG add "HKCU\Software\Microsoft\Internet Explorer\Download" /v "RunInvalidSignatures" /t "REG_DWORD" /d 1 /fREG add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v "SaveZoneInformation" /t "REG_DWORD" /d 1 /fREG add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Associations" /v "LowRiskFileTypes" /d ".cmd;.exe;.hta;" /freg import %cdrom%\wpi\software\Tools\NetzwerkinstallationEXE.regregedit /s %cdrom%\wpi\software\Tools\NetzwerkinstallationEXE.regREM create automatically a networkdrive (works only if the share is not password-protected)PUSHD \\192.168.x.xxx\DEPLOYREM Start WPI and wait until it was closedStart "running WPI..." /Wait WPI\wpi.exeREM removes the networkdrivePOPDNetzwerkinstallationEXE.regWindows Registry Editor Version 5.00[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Associations]"LowRiskFileTypes"=".exe;.cab;.msi;.msu;.cmd;.vbs"[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments]"SaveZoneInformation"=dword:1[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Download]"CheckExeSignatures"="no""RunInvalidSignatures"=dword:1thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now