Jump to content

Place executible in System32 folder, and launch it...


Recommended Posts

Hi all,

Rather than go through a large explination, I think it would be best if I just describe step by step what I would like done.

1. While windows is being installed, I would like to have an executible file placed in the Sys32 folder.

2. Before the themes setup and such, I would like that executible to be run.

3. If possible, I would like to have a shortcut placed on the desktop.

Can someone explain step by step how to do this? I already know how to do step 2, but I am having trouble with 1, and 3.

Thanks guys.

Link to comment
Share on other sites


1. Place the file in your $OEM$\$$\System32 folder and it will be copied over during setup.

3. Use shortcut.exe to make the shortcut. I make shortcuts in my cleanup.cmd. Syntax would be:

shortcut.exe /f:"%allusersprofile%\Desktop\myshortcut.lnk" /a:c /t:"%systemroot%\system32\myfile.exe"

Link to comment
Share on other sites

Or you could try a VBS script. This script adds Calc and Cmd to the Quick Launch.

Save MkShortCuts.vbs

'-> Object To Work With
Dim Act :Set Act = CreateObject("Wscript.Shell")
'-> Paths
Dim DTP :DTP = Act.SpecialFolders("Desktop")
Dim QCL :QCL = Act.ExpandEnvironmentStrings("%AppData%\Microsoft\Internet Explorer\Quick Launch")
Dim AUD :AUD = Act.SpecialFolders("AllUsersDesktop")
Dim ASM :ASM = Act.SpecialFolders("AllUsersStartMenu")
Dim AUP :AUP = Act.SpecialFolders("AllUsersPrograms")
Dim S32 :S32 = Act.ExpandEnvironmentStrings("%SystemRoot%\system32")
'-> Varibles For The ShortCuts
Dim Obj, Str
'-> Add Calc ShortCut
Str = S32 & "\calc.exe"
Set Obj = Act.CreateShortcut(QCL & "\Calc.lnk")
Obj.Description = "Open Calc And Do Some Math"
Obj.IconLocation = "calc.exe, 0"
Obj.TargetPath = Str
Obj.Save
'-> Add Cmd ShortCut
Str = S32 & "\cmd.exe"
Set Obj = Act.CreateShortcut(QCL & "\Cmd.lnk")
Obj.Description = "Open Command Prompt"
Obj.IconLocation = "cmd.exe, 0"
Obj.TargetPath = Str
Obj.Save

Link to comment
Share on other sites

Thanks everyone! Great info! :thumbup

Just one question.

EDIT

@gunsmokingman,

How would you recommend having the VBS script launched?

See, this will be placed on DVD and a Flash Drive. I will most likely use the one on the Flash Drive more often. Because of this, I doubt that %CDROOT% will be an applicable varible for Nlite. Should I have this placed in the Sys32 folder as well? And if so, is there a way to get it to self delete?

Edited by Draygoes
Link to comment
Share on other sites

3. If possible, I would like to have a shortcut placed on the desktop.

It can be done by OEM-Method, too.

Create a shortcut to your "my.exe" on the desktop of your running system.

Now copy this shortcut to your $OEM$-Folder at ""$OEM$\$DOCS\DEFAULT USER\Desktop".

The shortcut will be available for all users you create on the new system.

Link to comment
Share on other sites

I use that script in my RunOnceEx.cmd

REG ADD %KEY%\080 /VE /D "Add Quick Launch ShortCuts" /f
REG ADD %KEY%\080 /V 1 /D "%CDROM%\Apps\AddCalcCmd.vbs" /f

To make the script Delete it self

Make this your last line in the script.

CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptFullName),true

Link to comment
Share on other sites

Thank you for all your patiance and help so far.

As I mentioned before, I am likely to place this in a bootable flash drive. Wouldnt that break this line?

REG ADD %KEY%\080 /V 1 /D "%CDROM%\Apps\AddCalcCmd.vbs" /f

Heres the modified script. I tested it and it works right. I am big into sharing code, and I figured that you would appricate seeing how yours will be used.

'-> Object To Work With
Dim Act :Set Act = CreateObject("Wscript.Shell")
'-> Paths
Dim DTP :DTP = Act.SpecialFolders("Desktop")
Dim QCL :QCL = Act.ExpandEnvironmentStrings("%AppData%\Microsoft\Internet Explorer\Quick Launch")
Dim AUD :AUD = Act.SpecialFolders("AllUsersDesktop")
Dim ASM :ASM = Act.SpecialFolders("AllUsersStartMenu")
Dim AUP :AUP = Act.SpecialFolders("AllUsersPrograms")
Dim S32 :S32 = Act.ExpandEnvironmentStrings("%SystemRoot%\system32")
'-> Varibles For The ShortCuts
Dim Obj, Str
'-> Add Wallpaper Setup ShortCut
Str = S32 & "\setups.exe"
Set Obj = Act.CreateShortcut(AUD & "\Os Setup.lnk")
Obj.Description = "Install software and test the system security."
Obj.IconLocation = "setups.exe, 0"
Obj.TargetPath = Str
Obj.Save
'-> Add Wallpaper Gallery ShortCut
Str = S32 & "\dwallpaperg.exe"
Set Obj = Act.CreateShortcut(AUD & "\Wallpaper Selection Gallery.lnk")
Obj.Description = "View a custom wallpaper gallery in full screen mode, and choose desktop wallpaper."
Obj.IconLocation = "dwallpaperg.exe, 0"
Obj.TargetPath = Str
Obj.Save
'-> Add Cmd ShortCut
Str = S32 & "\cmd.exe"
Set Obj = Act.CreateShortcut(AUD & "\Cmd.lnk")
Obj.Description = "Open Command Prompt"
Obj.IconLocation = "cmd.exe, 0"
Obj.TargetPath = Str
Obj.Save
'-> Add Cmd ShortCut - Quick Launch
Str = S32 & "\cmd.exe"
Set Obj = Act.CreateShortcut(QCL & "\Cmd.lnk")
Obj.Description = "Open Command Prompt"
Obj.IconLocation = "cmd.exe, 0"
Obj.TargetPath = Str
Obj.Save
'-> After everything is said and done, the script is no longer needed. So now we have the script delete itself.
Set objFSO = CreateObject("Scripting.FileSystemObject")
strScript = Wscript.ScriptFullName
objFSO.DeleteFile(strScript)

Edited by Draygoes
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...