Jump to content

Recommended Posts

Posted (edited)

hi Im looking to have a simple simple dialog box that can work with a simple ini file with parameters that runs with builtin hidec ...

in appearance the dialog will similarly look like the "yes" "no" click options where each button carry out commands accordingly to what i place in the ini settings

where each left \ right arrow buttons are distinguished-with a title as given the ini settings

[<=] [=>]

[left-side]

title = "apply tweaks"

command="cmd /c %windir%\tweaks.reg /s"

[Right-side]

title = "switch to defaults"

command="cmd /c %windir%\Default.reg /s"

mmm and one more button that can do a quick log off then log on to the same account from where the command was first initiated off

all this preferably and eventually compiled to an exe ... ;)

TIA

Edited by sweept

Posted

Here try this HTA, it has 2 checkboxes. If either of these files %windir%\tweaks.reg or %windir%\Default.reg are missing then the checkboxes are disable.

Save as Reg.hta

<TITLE>Demo App</TITLE>
<HTA:APPLICATION ID='Demo App'
Scroll='No'
SCROLLFLAT ='No'
SingleInstance='Yes'
SysMenu='Yes'
MaximizeButton='No'
MinimizeButton='Yes'
Border='Thin'
BORDERSTYLE ='complex'
INNERBORDER ='Yes'
Caption='Yes'
WindowState='Normal'
APPLICATIONNAME='DemoApp'
Icon='%SystemRoot%\explorer.exe'>
<STYLE Type='text/css'>
Body
{
Font-Size:8.25pt;
Font-Weight:Bold;
Font-Family:Arial,Tahoma,Comic Sans MS,Segoe Ui;
Color:#000063;
BackGround-Color:Transparent;
Filter:progid:DXImageTransform.Microsoft.Gradient
(StartColorStr='#FEF7F2',endColorStr='#D2CBC6');
Margin-Top:3;
Margin-Bottom:3;
Margin-Left:4;
Margin-Right:4;
Padding-Top:1;
Padding-Bottom:1;
Padding-Left:4;
Padding-Right:4;
Text-Align:Center;
Vertical-Align:Top;
Border-Top:1px Solid #cbc7c3;
Border-Bottom:2px Solid #D2CBC6;
Border-Left:1px Solid #bcb8b4;
Border-Right:2px Solid #D2CBC6;
}
TD.Type1
{
Width:99pt;
Font-Size:8.05pt;
Font-Weight:Bold;
Font-Family:Arial,Tahoma,Comic Sans MS,Segoe Ui;
Color:#005400;
Margin-Left:2pt;
Margin-Right:2pt;
Margin-Top:1pt;
Margin-Bottom:1pt;
Padding-Left:9pt;
Padding-Right:2pt;
Padding-Top:1pt;
Padding-Bottom:1pt;
}
TD.Type2
{
Text-Align:Center;
Vertical-Align:Middle;
Margin-Left:1pt;
Margin-Right:1pt;
Margin-Top:1pt;
Margin-Bottom:1pt;
Padding-Left:1pt;
Padding-Right:1pt;
Padding-Top:1pt;
Padding-Bottom:1pt;
}
</STYLE>
<script language='VBScript'>
'-> Resize The Window
window.ResizeTo 375,225
'-> Varibles As Objects
Dim Act :Set Act = Createobject("Wscript.Shell")
Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
'-> Varibles For The Reg Files
Dim RegDefault1, RegTweak1
RegTweak1 = Act.ExpandEnvironmentStrings("%windir%\tweaks.reg")
RegDefault1 = Act.ExpandEnvironmentStrings("%windir%\Default.reg")
'-> Onload Function
Function Window_Onload()
CheckForRegFiles()
End Function
'-> Check For The Reg Files
Function CheckForRegFiles()
Dim RFont
RFont = "<FONT STYLE='COLOR:#AD1212;'>"
If Not Fso.FileExists(RegTweak1) Then
Item_01.disabled = True
TD_01.innerHTML = RFont & "Missing Reg Tweak</FONT>"
Else
Item_01.disabled = False
End If
If Not Fso.FileExists(RegDefault1) Then
Item_02.disabled = True
TD_02.innerHTML = RFont & "Missing Reg Default</FONT>"
Else
Item_02.disabled = False
End If
Exit Function
End Function
'-> Check For Checkbox1
Function Checkbox1Change()
If Item_01.Checked Then
Act.Run("Cmd /C " & RegTweak1 & " /S"),0,True
End If
Exit Function
End Function
'-> Check For Checkbox2
Function Checkbox2Change()
If Item_02.Checked Then
Act.Run("Cmd /C " & RegDefault1 & " /S"),0,True
End If
Exit Function
End Function
</SCRIPT>
<BODY Scroll='No'>
<!-- TEXT AREA -->
<TABLE>Select either the tweak or default</TABLE>
<!-- CHECKBOX 1 -->
<TABLE Border='1'>
<TD Class='Type1' ID='TD_01'>Reg Tweak</TD>
<TD Class='Type2'><INPUT Type='Checkbox' Name='Item_01' Value='tweaks.reg' OnClick='Checkbox1Change()'></TD>
</TABLE>
<!-- CHECKBOX 2 -->
<TABLE Border='1'>
<TD Class='Type1' ID='TD_02'>Reg Default</TD>
<TD Class='Type2'><INPUT Type='Checkbox' Name='Item_02' Value='Default.reg' OnClick='Checkbox2Change()'></TD>
</TABLE>
</BODY>

Posted (edited)

thanks gunsmokingman

I was leaning towards somehing that allows adding any commands I wanted with no conditions

with an sfx I can then easilly place the "settings.ini" along any other files I needed..

the Dialog simply gives a Choice as what to run out of 2 options set in Group1 & Group2

for optimizing the command line the script could auto pend "cmd /c " to the begining of each command

Mysettings.ini

Main Prog Title:""

Title Group1:"Tweaks"

Group1 Description Ballon Tip:"this Option will add some minor tweaks that includes:...."

[Cmmands1]

"start.bat"

"copy /y regTweaks %windir%"

"%windir%\regTweaks.reg /s"

Title Group2:"revert to Defaults"

Group2 Description Ballon Tip:"this option will restore settings prior to using the ^"Tweaks option^" and attempt to remove any files and additional setting it has created"

[Cmmands2]

"start.bat"

"restore.reg /s"

added to this a [Quick automatic logoff\logn to the same user] Button and perhaps 2 more: [Apply] [Exit] Buttons and that is all ;)

for now I'll try the above script to make it work specifically to what I need

as I need it for applying a swift change in settings

how can I add to this a box that offers automatic log off & log on to the same account ...

TIA

Edited by sweept

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...