Can anyone create this?

calcor

Member
Messages
43
Location
United Kingdom
Hi,
I need to create a log off shortcut for my users, so that they can log off (obviously).

However i need it to ask them to confirm the action.

If they click yes, it logs them off (using "shutdown -l") and if they click no it simply closes the dialog box.

If anyone could be so AMAZING as to help me with this i would be SO grateful!:thumb:

(SOMETHING LIKE THIS:)

Picture1.png

This does not actually function it wont run anything, but the script is:
x=msgbox ("Log Off?" ,4+64, "Confirm Log Off")

i also tried this along with other scripts but none worked :(
x=msgbox ("Log Off?" ,4+64, "Confirm Log Off")
If Continue = vbYes then
if vbYes = run shutdown.exe -l
Else
End If
 

My Computer

System One

  • OS
    Windows 11 Pro 64-bit
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom
    CPU
    AMD Ryzen 7 3700X Eight Core CPU (3.6GHz-4.4GHz/36MB CACHE/AM4)
    Motherboard
    ASUS® ROG STRIX X570-F GAMING (USB 3.2 Gen 2, PCIe 4.0)
    Memory
    32GB Corsair VENGEANCE DDR4 3200MHz (4 x 8GB)
    Graphics Card(s)
    Nvidia GeForce RTX 3070Ti
    Monitor(s) Displays
    Philips 32:9 SuperWide curved LCD display 499P9H/00
    Screen Resolution
    5120 x 1440
    Hard Drives
    500GB SAMSUNG 970 EVO PLUS M.2, PCIe NVMe
    2TB Crucial SSD
    2TB SanDisk SSD
    1TB Cruciaul SSD
    240GB HyperX SSD
    PSU
    CORSAIR 850W RMx SERIES™ MODULAR 80 PLUS® GOLD
    Case
    PHANTEKS ECLIPSE P400 AIR MIDI TOWER CASE - BLACK
    Cooling
    BeQuiet Dark Rock 4
    Keyboard
    Logitech MX Keys
    Mouse
    Logitech MX Master 3
    Internet Speed
    350 Mb/s Download and 35 Mb/s Upload
    Browser
    Google Chrome
    Antivirus
    Bitdefender Endpoint Security
Why rebuild the wheel. Ctrl-Alt-Del, or when they are in desktop mode, use either Classic Shell or Start8 to give them the same features as what are in Windows 7.
 

My Computer

System One

  • OS
    Linux Mint 17.2
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Satellite C850D-st3nx1
    CPU
    AMD E1-1200 APU with Radeon (tm) HD Graphics 1.40 GHZ
    Memory
    12GB
    Graphics Card(s)
    AMD Radeon™ HD 7310 Graphics
    Sound Card
    Realtek HD
    Monitor(s) Displays
    LCD
    Screen Resolution
    1366 x 768
    Hard Drives
    Crucial M500 240GB SSD
    Mouse
    Logitech M525
    Internet Speed
    45/6 - ATT U-Verse
    Browser
    Google Chrome
    Antivirus
    None needed. It is Linux.
    Other Info
    Arris NVG589 Gateway; Router - Cisco RV320; Switch - Netgear GS108 8-Port Switch & Trendnet TEG-S50g 5-Port Switch; Access Points - Engenius ECB350, Trendnet TEW-638APB; NAS - Lenovo ix2-4; Printer - Brother HL-2280DW; Air Print Server - Lantronix XPrintServer

    A/V UPS - Tripp-Lite Smart 1500LCD 1500 Va/900 W.
I need a desktop shortcut. They are not very 'technologically minded'
And I had classic shell installed previously but it ruined my system.
 

My Computer

System One

  • OS
    Windows 11 Pro 64-bit
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom
    CPU
    AMD Ryzen 7 3700X Eight Core CPU (3.6GHz-4.4GHz/36MB CACHE/AM4)
    Motherboard
    ASUS® ROG STRIX X570-F GAMING (USB 3.2 Gen 2, PCIe 4.0)
    Memory
    32GB Corsair VENGEANCE DDR4 3200MHz (4 x 8GB)
    Graphics Card(s)
    Nvidia GeForce RTX 3070Ti
    Monitor(s) Displays
    Philips 32:9 SuperWide curved LCD display 499P9H/00
    Screen Resolution
    5120 x 1440
    Hard Drives
    500GB SAMSUNG 970 EVO PLUS M.2, PCIe NVMe
    2TB Crucial SSD
    2TB SanDisk SSD
    1TB Cruciaul SSD
    240GB HyperX SSD
    PSU
    CORSAIR 850W RMx SERIES™ MODULAR 80 PLUS® GOLD
    Case
    PHANTEKS ECLIPSE P400 AIR MIDI TOWER CASE - BLACK
    Cooling
    BeQuiet Dark Rock 4
    Keyboard
    Logitech MX Keys
    Mouse
    Logitech MX Master 3
    Internet Speed
    350 Mb/s Download and 35 Mb/s Upload
    Browser
    Google Chrome
    Antivirus
    Bitdefender Endpoint Security

My Computer

System One

  • OS
    Windows 11 Pro 64-bit
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom
    CPU
    AMD Ryzen 7 3700X Eight Core CPU (3.6GHz-4.4GHz/36MB CACHE/AM4)
    Motherboard
    ASUS® ROG STRIX X570-F GAMING (USB 3.2 Gen 2, PCIe 4.0)
    Memory
    32GB Corsair VENGEANCE DDR4 3200MHz (4 x 8GB)
    Graphics Card(s)
    Nvidia GeForce RTX 3070Ti
    Monitor(s) Displays
    Philips 32:9 SuperWide curved LCD display 499P9H/00
    Screen Resolution
    5120 x 1440
    Hard Drives
    500GB SAMSUNG 970 EVO PLUS M.2, PCIe NVMe
    2TB Crucial SSD
    2TB SanDisk SSD
    1TB Cruciaul SSD
    240GB HyperX SSD
    PSU
    CORSAIR 850W RMx SERIES™ MODULAR 80 PLUS® GOLD
    Case
    PHANTEKS ECLIPSE P400 AIR MIDI TOWER CASE - BLACK
    Cooling
    BeQuiet Dark Rock 4
    Keyboard
    Logitech MX Keys
    Mouse
    Logitech MX Master 3
    Internet Speed
    350 Mb/s Download and 35 Mb/s Upload
    Browser
    Google Chrome
    Antivirus
    Bitdefender Endpoint Security
I found this to make a batch file. Should be able to edit command and text to work for log off also:

@ECHO OFF
:: This batch file allows the user to choose to shutdown immediately, or cancel and return to Windows
::
CD\
CLS
ECHO.
:LOOP
ECHO Would you like to shutdown immediately?
ECHO.
ECHO Y = SHUTDOWN IMMEDIATELY (WARNING!! Unsaved work will be lost)
ECHO N = CANCEL and return to Windows
ECHO.
SET Choice=
SET /P Choice=TYPE YOUR CHOICE AND PRESS ENTER:
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
IF '%Choice%'=='y' GOTO ShutdownNow
IF '%Choice%'=='n' GOTO Leave
ECHO "%Choice%" is not valid. Please try again.
ECHO.
GOTO Loop
:ShutdownNow
ECHO.
shutdown /s /t 1

:Leave
Exit

EDIT: Command for log off: shutdown /l = Log off and /f = force
 

My Computer

System One

  • OS
    Windows 8.1 Pro 64-bit
    Computer type
    Laptop
    System Manufacturer/Model
    Acer V3 771G-6443
    CPU
    i5-3230m
    Motherboard
    Acer VA70_HC (U3E1)
    Memory
    8GB DDR3 PC3-12800 (800 MHz)
    Graphics Card(s)
    HD4000 + GeForce GT 730M
    Sound Card
    Realtek High Definition Audio
    Monitor(s) Displays
    17" Generic PnP Display on Intel HD Graphics 4000
    Screen Resolution
    1600x900 pixels
    Hard Drives
    Samsung SSD 850 EVO 250 GB
    ADATA SSD SP900 128GB
    PSU
    90 watt brick
    Mouse
    Bluetooth
    Antivirus
    Comodo
    Other Info
    Asus RT-AC56R dual-band WRT router (Merlin firmware). Intel 7260.HMWWB.R dual-band ac wireless adapter.
I just get "Log Off?"
if yes - no confirm -Just log out

If No - "Do You Want To Quit"
Yes or No - closes dialog
 

My Computer

System One

  • OS
    Windows 3.1 > Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Dell XPS 8700
    CPU
    I7
    Memory
    24 GB
Was not trying to offend...

Testing - Log Off - but then no Log Off Confirm..

Quit Box just Closes - Y or N

VBS = yes off - No close dialog box
 

My Computer

System One

  • OS
    Windows 3.1 > Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Dell XPS 8700
    CPU
    I7
    Memory
    24 GB
It is exactly what he asked for:
If they click yes, it logs them off (using "shutdown -l") and if they click no it simply closes the dialog box.
 

My Computer

System One

  • OS
    7/8/ubuntu/Linux Deepin
    Computer type
    PC/Desktop
Yes Sir.. It is..
 

My Computer

System One

  • OS
    Windows 3.1 > Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Dell XPS 8700
    CPU
    I7
    Memory
    24 GB
It is exactly what he asked for:
If they click yes, it logs them off (using "shutdown -l") and if they click no it simply closes the dialog box.

You the man! Exactly as OP requested, I hope he/she comes back to see it. :thumb:
 

My Computer

System One

  • OS
    Windows 8.1 Pro 64-bit
    Computer type
    Laptop
    System Manufacturer/Model
    Acer V3 771G-6443
    CPU
    i5-3230m
    Motherboard
    Acer VA70_HC (U3E1)
    Memory
    8GB DDR3 PC3-12800 (800 MHz)
    Graphics Card(s)
    HD4000 + GeForce GT 730M
    Sound Card
    Realtek High Definition Audio
    Monitor(s) Displays
    17" Generic PnP Display on Intel HD Graphics 4000
    Screen Resolution
    1600x900 pixels
    Hard Drives
    Samsung SSD 850 EVO 250 GB
    ADATA SSD SP900 128GB
    PSU
    90 watt brick
    Mouse
    Bluetooth
    Antivirus
    Comodo
    Other Info
    Asus RT-AC56R dual-band WRT router (Merlin firmware). Intel 7260.HMWWB.R dual-band ac wireless adapter.
I found this to make a batch file. Should be able to edit command and text to work for log off also:

@ECHO OFF
:: This batch file allows the user to choose to shutdown immediately, or cancel and return to Windows
::
CD\
CLS
ECHO.
:LOOP
ECHO Would you like to shutdown immediately?
ECHO.
ECHO Y = SHUTDOWN IMMEDIATELY (WARNING!! Unsaved work will be lost)
ECHO N = CANCEL and return to Windows
ECHO.
SET Choice=
SET /P Choice=TYPE YOUR CHOICE AND PRESS ENTER:
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
IF '%Choice%'=='y' GOTO ShutdownNow
IF '%Choice%'=='n' GOTO Leave
ECHO "%Choice%" is not valid. Please try again.
ECHO.
GOTO Loop
:ShutdownNow
ECHO.
shutdown /s /t 1

:Leave
Exit

EDIT: Command for log off: shutdown /l = Log off and /f = force

That's great! Is there any way of modifying this to log off instead of shutdown? Or am I being extremely stupid and this is in fact a log off script (it's just, it mentions shutdown a lot)?
 

My Computer

System One

  • OS
    Windows 11 Pro 64-bit
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom
    CPU
    AMD Ryzen 7 3700X Eight Core CPU (3.6GHz-4.4GHz/36MB CACHE/AM4)
    Motherboard
    ASUS® ROG STRIX X570-F GAMING (USB 3.2 Gen 2, PCIe 4.0)
    Memory
    32GB Corsair VENGEANCE DDR4 3200MHz (4 x 8GB)
    Graphics Card(s)
    Nvidia GeForce RTX 3070Ti
    Monitor(s) Displays
    Philips 32:9 SuperWide curved LCD display 499P9H/00
    Screen Resolution
    5120 x 1440
    Hard Drives
    500GB SAMSUNG 970 EVO PLUS M.2, PCIe NVMe
    2TB Crucial SSD
    2TB SanDisk SSD
    1TB Cruciaul SSD
    240GB HyperX SSD
    PSU
    CORSAIR 850W RMx SERIES™ MODULAR 80 PLUS® GOLD
    Case
    PHANTEKS ECLIPSE P400 AIR MIDI TOWER CASE - BLACK
    Cooling
    BeQuiet Dark Rock 4
    Keyboard
    Logitech MX Keys
    Mouse
    Logitech MX Master 3
    Internet Speed
    350 Mb/s Download and 35 Mb/s Upload
    Browser
    Google Chrome
    Antivirus
    Bitdefender Endpoint Security
@corriganc

SIW2 posted a working solution...

Shutdown is the executable - depends on the arguments you supply (-s to shutdown, -r to restart, -l to logoff)

Here's another fancy View attachment CreateLogoff.vbs (adapted from MS example) that creates a shortcut in start menu.

.logoff.png
 
Last edited:

My Computer

System One

  • OS
    PC-DOS v1.0
    Computer type
    PC/Desktop
    System Manufacturer/Model
    IBM
    CPU
    Intel 8088, 4.77MHz
    Memory
    16K, 640K max
    Graphics Card(s)
    What's that?
    Sound Card
    Not quite
    Screen Resolution
    80 X 24 text
    Hard Drives
    dual 160KB 5.25-inch disk drives
Thankyou all so much (especially SIW2) this is exactly what I have been looking for!
 

My Computer

System One

  • OS
    Windows 11 Pro 64-bit
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom
    CPU
    AMD Ryzen 7 3700X Eight Core CPU (3.6GHz-4.4GHz/36MB CACHE/AM4)
    Motherboard
    ASUS® ROG STRIX X570-F GAMING (USB 3.2 Gen 2, PCIe 4.0)
    Memory
    32GB Corsair VENGEANCE DDR4 3200MHz (4 x 8GB)
    Graphics Card(s)
    Nvidia GeForce RTX 3070Ti
    Monitor(s) Displays
    Philips 32:9 SuperWide curved LCD display 499P9H/00
    Screen Resolution
    5120 x 1440
    Hard Drives
    500GB SAMSUNG 970 EVO PLUS M.2, PCIe NVMe
    2TB Crucial SSD
    2TB SanDisk SSD
    1TB Cruciaul SSD
    240GB HyperX SSD
    PSU
    CORSAIR 850W RMx SERIES™ MODULAR 80 PLUS® GOLD
    Case
    PHANTEKS ECLIPSE P400 AIR MIDI TOWER CASE - BLACK
    Cooling
    BeQuiet Dark Rock 4
    Keyboard
    Logitech MX Keys
    Mouse
    Logitech MX Master 3
    Internet Speed
    350 Mb/s Download and 35 Mb/s Upload
    Browser
    Google Chrome
    Antivirus
    Bitdefender Endpoint Security
Back
Top