Skip to content
View in the app

A better way to browse. Learn more.

MSFN

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.

Help Automating a few bits..

Featured Replies

Right,

I need to add a domain security group to the local admin group on machines & i have been told we cannot do it through AD as it will knock out any other users that have been manually put into the odd machines local admin group.

How can I automate the process of adding a domain security group to the local admin group on install?

Also,

from the runonce i want the defragmenter "mmc dfrg.msc"

to open & run a defragmentation. how can i automate this with what switches to set it running.? I know this can run behind the scenes but i need this to run visually.

all help is greatly apreciated..

Edited by chiners_68


I need to add a domain security group to the local admin group on machines & i have been told we cannot do it through AD as it will knock out any other users that have been manually put into the odd machines local admin group. How can I automate the process of adding a domain security group to the local admin group on install

Here's how I do it:

I have a file called Admins.cmd that contains the following code:

net localgroup "Administrators" /ADD "MFC\TN_DTS_WrkAdm"

It's saved in the $1\Installs folder on the CD. This is called by the following statement in RunOnce:

REG ADD %KEY%\075 /VE /D "Adding Administrators" /f

REG ADD %KEY%\075 /V 1 /D "%systemdrive%\install\admins.cmd" /f

Hope this helps!

Here is a defrag script that runs hidden

Const Hidden = 0,Normal = 1,Min = 2
Const HD = 2
Dim Act, Fso, Drv
Set Act = CreateObject("Wscript.Shell")
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Drv = Fso.Drives
For Each objDrv in Drv
If objDrv.DriveType = HD Then
Act.Run("Defrag.exe " & objDrv & "\ -F"),Hidden,True
End if
Next

gunsmokingman you weren't kidding when you said you know how to script!

Thanks, here is one in Js Script this has a pop up that will tell you what drive it defragging

Save As Defrag.js

var Fso = new ActiveXObject("Scripting.FileSystemObject");
var Act = new ActiveXObject("Wscript.Shell");
var Drv, strDrv, s, Defrag, V; V = "\\"
Disk()
function Disk()
{for ( var objEnum = new Enumerator(Fso.drives);!objEnum.atEnd();objEnum.moveNext())
{Drv = objEnum.item()
if (Drv.IsReady) {if (Drv.DriveType == "2")
Defrag = Act.Popup ("Preparing To Defrag This Drive, " + Drv.Path +
V+'\n'+ "Volume Name : " +Drv.VolumeName ,5,"Temp Stop", 0 + 32);
Act.Run("Defrag.exe " +Drv.Path+V+ " -F",0,true);
}} return;}

  • Author

Right,

Im runnig this script for defragmenting.

var Fso = new ActiveXObject("Scripting.FileSystemObject");

var Act = new ActiveXObject("Wscript.Shell");

var Drv, strDrv, s, Defrag, V; V = "\\"

Disk()

function Disk()

{for ( var objEnum = new Enumerator(Fso.drives);!objEnum.atEnd();objEnum.moveNext())

{Drv = objEnum.item()

if (Drv.IsReady) {if (Drv.DriveType == "2")

Defrag = Act.Popup ("Preparing To Defrag This Drive, " + Drv.Path +

V+'\n'+ "Volume Name : " +Drv.VolumeName ,5,"Temp Stop", 0 + 32);

Act.Run("Defrag.exe " +Drv.Path+V+ " -F",0,true);

}} return;}

but it runs silently without a progress bar or anything..

This uses the cmd interface to defrag so there is no progress bar I have set it so it sits min on the task bar.

Save As Defrag_Min.js

var Fso = new ActiveXObject("Scripting.FileSystemObject");
var Act = new ActiveXObject("Wscript.Shell");
var Drv, strDrv, s, Defrag, V; V = "\\"
Disk()
function Disk()
{for ( var objEnum = new Enumerator(Fso.drives);!objEnum.atEnd();objEnum.moveNext())
{Drv = objEnum.item()
if (Drv.IsReady) {if (Drv.DriveType == "2")
Defrag = Act.Popup ("Preparing To Defrag This Drive, " + Drv.Path +
V+'\n'+ "Volume Name : " +Drv.VolumeName ,5,"Temp Stop", 0 + 32);
Act.Run("Defrag.exe " +Drv.Path+V+ " -F",2,true);
}} return;}

Yhis makes it the max size

Save As Defrag_Max.js

var Fso = new ActiveXObject("Scripting.FileSystemObject");
var Act = new ActiveXObject("Wscript.Shell");
var Drv, strDrv, s, Defrag, V; V = "\\"
Disk()
function Disk()
{for ( var objEnum = new Enumerator(Fso.drives);!objEnum.atEnd();objEnum.moveNext())
{Drv = objEnum.item()
if (Drv.IsReady) {if (Drv.DriveType == "2")
Defrag = Act.Popup ("Preparing To Defrag This Drive, " + Drv.Path +
V+'\n'+ "Volume Name : " +Drv.VolumeName ,5,"Temp Stop", 0 + 32);
Act.Run("Defrag.exe " +Drv.Path+V+ " -F",1,true);
}} return;}

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.