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.

batch get hostname supress 7th caracters...

Featured Replies

Helloo!!!

i would like to make a BATCH or a VBS which get the HOSTNAME, supress ALL the caracters after the 7th and to add AB at the end...

also i would like to connect a drive to it:

net use o: \\XXXXXXXAB\folder$

is it possible?

It depends on if you want to use the computername or the hostname (they are normally the same) though)

Here is a vbscript using the computername (run using cscript scriptname.vbs)

' get computer name

Set oWshShell = CreateObject( "WScript.Shell" )
Set oWshNetwork = WScript.CreateObject( "WScript.Network" )
sComputerName = oWshNetwork.ComputerName

sCmd = "net use O: \\" & Left(sComputerName,7) & "AB\folder$"

wscript.echo "Executing commandline: " & sCmd

oWshShell.run sCmd,0,True

Here is a vbscript using the hostname from registry (run using cscript scriptname.vbs)

' get hostname

Set oWshShell = CreateObject( "WScript.Shell" )
sRegValue = "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Hostname"
sHostName = oWshShell.RegRead( sRegValue )

sCmd = "net use O: \\" & Left(sHostName,7) & "AB\folder$"

wscript.echo "Executing commandline: " & sCmd

oWshShell.run sCmd,0,True

Using Windows Command Script

Example.cmd

@ECHO OFF&SETLOCAL
(SET H_=)
FOR /F %%# IN ('HOSTNAME') DO (SET H_=%%#)
IF DEFINED H_ (NET USE O: \\%H_:~,7%AB\folder$)

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.