Jump to content
View in the app

A better way to browse. Learn more.

WinCert.net Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi,

 

I need to build in my Win7-ISO (WinToolkit) a function setting a link on the desktop to start a program (WPI.exe).

The WPI-Folder is in the ISO and I want that the final user has to start only this link.

 

After the Win installation the ISO is still mounted (VM) or the DVD ist still in the drive.

 

My problems are: I don't know, how can I make the variable %DVD% available to Windows during the installation and which command in a .BAT or .CMD file I need.

 

Can somebody give me some hints?

 

TNX, Thiersee

Hi Thiersee,

I didn't test this method but I find people using this.

Set a distinguishable file in the ISO (ex: myfile.txt) than ad this to the code
 

@echo offfor %%a in (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 "%%a:\myfile.txt" set "drv=%%a:"

Hi,

I need to build in my Win7-ISO (WinToolkit) a function setting a link on the desktop to start a program (WPI.exe).

The WPI-Folder is in the ISO and I want that the final user has to start only this link.

After the Win installation the ISO is still mounted (VM) or the DVD ist still in the drive.

My problems are: I don't know, how can I make the variable %DVD% available to Windows during the installation and which command in a .BAT or .CMD file I need.

Can somebody give me some hints?

TNX, Thiersee

I use this from a long time ago to start WPI from %windir%\temp folder : (not fail with empty devices as card readers)

@ECHO OFFSETLOCAL(SET USB=)FOR /F "USEBACKQ TOKENS=2 DELIMS==" %%# IN (`WMIC DATAFILE WHERE^ "PATH='\\WPI\\' AND FILENAME='WPI' AND EXTENSION='exe'"^ GET Name /VALUE^|FIND "="`) DO SET "USB=%%~d#"&SET "FPATH=%%#"START "" "%FPATH%" & exit

I run this cmd from Autounattend.xml

 

<FirstLogonCommands>

             <SynchronousCommand wcm:action="add">

                 <CommandLine>cmd /q /c start %windir%\Temp\WPI.cmd</CommandLine>

                 <Description>Run WPI</Description>

                 <Order>1</Order>

                 <RequiresUserInput>false</RequiresUserInput>

             </SynchronousCommand>

 </FirstLogonCommands>

 

Regards... ;-)

 

To only create shortcut in Desktop use this: (I found script here http://superuser.com/questions/392061/how-to-make-a-shortcut-from-cmd)

@ECHO OFFSETLOCAL(SET USB=)FOR /F "USEBACKQ TOKENS=2 DELIMS==" %%# IN (`WMIC DATAFILE WHERE^ "PATH='\\WPI\\' AND FILENAME='WPI' AND EXTENSION='exe'"^ GET Name /VALUE^|FIND "="`) DO SET "USB=%%~d#"&SET "FPATH=%%#"::START "" "%FPATH%" & exitecho Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbsecho sLinkFile = "%HOMEDRIVE%%HOMEPATH%\Desktop\WPI.lnk" >> CreateShortcut.vbsecho Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbsecho oLink.TargetPath = "%FPATH%" >> CreateShortcut.vbsecho oLink.Save >> CreateShortcut.vbscscript CreateShortcut.vbsdel CreateShortcut.vbsexit

Tested:

XojJrJ2.png

WPI.rar

Edited by alfreire

  • Author

Thanks a lot alfreire!

 

I don't want to start it from the autoexec,xml, so I would need only the last part, but

 

 

@ECHO OFF

SETLOCAL

(SET USB=)
FOR /F "USEBACKQ TOKENS=2 DELIMS==" %%# IN (`WMIC DATAFILE WHERE^
"PATH='\\WPI\\' AND FILENAME='WPI' AND EXTENSION='exe'"^
GET Name /VALUE^|FIND "="`
) DO SET "USB=%%~d#"&SET "FPATH=%%#"

::START "" "%FPATH%" & exit

you set here USB, I need DVD, how can I modify it?

Thanks a lot alfreire!

 

I don't want to start it from the autoexec,xml, so I would need only the last part, but

 

 

@ECHO OFF

SETLOCAL

(SET USB=)

FOR /F "USEBACKQ TOKENS=2 DELIMS==" %%# IN (`WMIC DATAFILE WHERE^

"PATH='\\WPI\\' AND FILENAME='WPI' AND EXTENSION='exe'"^

GET Name /VALUE^|FIND "="`) DO SET "USB=%%~d#"&SET "FPATH=%%#"

::START "" "%FPATH%" & exit

you set here USB, I need DVD, how can I modify it?

Anyway, works for USB & DVD indistinctly... you can change USB to DVD if you want...

@ECHO OFFSETLOCAL(SET DVD=)FOR /F "USEBACKQ TOKENS=2 DELIMS==" %%# IN (`WMIC DATAFILE WHERE^ "PATH='\\WPI\\' AND FILENAME='WPI' AND EXTENSION='exe'"^ GET Name /VALUE^|FIND "="`) DO SET "DVD=%%~d#"&SET "FPATH=%%#"::START "" "%FPATH%" & exit

%DVD% is drive letter

%FPATH% is full path to WPI.exe (%DVD%\WPI\WPI.exe)

 

You can delete ::START "" "%FPATH%" & exit if not want start WPI from cmd...

 

Regards... ;-)

 

I think you need only this:

@ECHO OFFSETLOCAL(SET DVD=)FOR /F "USEBACKQ TOKENS=2 DELIMS==" %%# IN (`WMIC DATAFILE WHERE^ "PATH='\\WPI\\' AND FILENAME='WPI' AND EXTENSION='exe'"^ GET Name /VALUE^|FIND "="`) DO SET "DVD=%%~d#"&SET "FPATH=%%#"echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbsecho sLinkFile = "%HOMEDRIVE%%HOMEPATH%\Desktop\WPI.lnk" >> CreateShortcut.vbsecho Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbsecho oLink.TargetPath = "%FPATH%" >> CreateShortcut.vbsecho oLink.Save >> CreateShortcut.vbscscript CreateShortcut.vbsdel CreateShortcut.vbsexit

WPI.rar

Edited by alfreire

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.