Need Help- Quick Batch File / Location

jjewel33

New member
Local time
3:15 PM
Messages
6
Location
New England
Hello we are running Windows 7 Enterprise x32
When you click on the Start Button Win7 has the Projector mode toggle.

They want it to Automatically Clone with no choice needed by our "lazy" users.

Now the word is Duplicate on the toggle bar so I am not sure which word to use. NOR am I sure where to place this file for it to run at start up for all users.

@ECHO OFF
c:\\Windows\System32\DisplaySwitch.exe /duplicate
cls
 

My Computer

Computer Manufacturer/Model Number
Dell Optiplex GX780
OS
Win7 Enterprise 64 bit
Monitor(s) Displays
Dell 23" WideScreen
Hello Jewel, and welcome to Seven Forums.

You could create a shortcut using the tutorial below with the target location below to have it switch to "Duplicate" when used.

C:\Windows\System32\DisplaySwitch.exe /clone

http://www.sevenforums.com/tutorials/37625-display-switch-shortcut-create.html

Once the shortcut is created, you could save it where you like (ex: in a C:\Users\Public folder), then use the tutorial below to create a task to run this shortcut from this location at startup for all users.

http://www.sevenforums.com/tutorials/67503-task-create-run-program-startup-log.html

Hope this helps,
Shawn
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
That is a very cool shortcut.
Unfortunately where I work the "users" (faculty) have all their computers set up so they do not have to touch any extra buttons. I cannot have a shortcut they need to click on. It must be a Batch File, needs to run at start up for all users and needs to set this to clone by default so when they turn on the projector it is already projecting on the screen with no interaction needed. (These same "users" also want the speakers to default to "on"--as though we can control someone turning off the speakers with the on/off button????)
 

My Computer

Computer Manufacturer/Model Number
Dell Optiplex GX780
OS
Win7 Enterprise 64 bit
Monitor(s) Displays
Dell 23" WideScreen
That's fine.

Once the shortcut is created, you would save the shortcut to where you like to keep it saved at (ex: in a C:\Users\Public folder), then use the tutorial below to create a task to run this shortcut from this location at startup for all users. :)

Task - Create to Run a Program at Startup and Log On

LOL, I can't help with the speakers either. They'll just have to be turned on.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Nope, that is not going to work either!! These machines will be logged on to by multiple users with various rights and permissions.

------------------------------------------------------------

I was already told I need to use this: C:\Windows\System32\DisplaySwitch.exe /clone


but I am writing my batch file wrong...........


And it needs to go here:

I put the batch in the all users startup. C:\ProgramData\Microsoft\Windows\StartMenu\Programs\Startup
 

My Computer

Computer Manufacturer/Model Number
Dell Optiplex GX780
OS
Win7 Enterprise 64 bit
Monitor(s) Displays
Dell 23" WideScreen
You don't actually need to create a batch file for this. You can simply make an entry in the registry.

Open the registry editor with administrative privileges and browse to the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Right-click in the right-hand panel and select New String Value. It doesn't matter what you call this string, so just press Enter. Now, right-click on this entry and click Modify... and in the dialogue box type the following:

C:\Windows\System32\DisplaySwitch.exe /clone

Now press Enter and close the registry editor. When you next restart your computer, this command will be executed regardless of who has logged in (including yourself, as Administrator).

Alternatively, I have prepared a downloadable registry file which will achieve the same thing. You can only merge this file into the registry from within an administrative account.


Download

 

Attachments

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dwarf Dwf/11/2012 r09/2013
OS
Windows 8.1 Pro RTM x64
CPU
Intel Core-i5-3570K 4-core @ 3.4GHz (Ivy Bridge) (OC 4.4GHz)
Motherboard
ASRock Z77 Extreme4-M
Memory
4 x 4GB DDR3-1600 Corsair Vengeance CMZ8GX3M2A1600C9B (16GB)
Graphics Card(s)
MSI GeForce GTX770 Gaming OC 2GB
Sound Card
Realtek High Definition on board solution (ALC 898)
Monitor(s) Displays
ViewSonic VA1912w Widescreen (VGA)
Screen Resolution
1440x900
Hard Drives
OCZ Agility 3 SSD 120GB SATA III x2 (RAID 0)
Samsung HD501LJ 500GB SATA II x2
Hitachi HDS721010CLA332 1TB SATA II
Iomega 1.5TB Ext USB 2.0
WD 2.0TB Ext USB 3.0
PSU
XFX Pro Series 850W Semi-Modular
Case
Gigabyte IF233
Cooling
1 x 120mm Front Inlet 1 x 120mm Rear Exhaust
Keyboard
Microsoft Comfort Curve Keyboard 3000 (USB)
Mouse
Microsoft Comfort Mouse 3000 for Business (USB)
Internet Speed
NetGear DG834Gv3 ADSL Modem/Router (Ethernet) ~4.0 Mb/s (O2)
Antivirus
Avast! 8.0.1497
Browser
IE 11
Other Info
Optical Drive: HL-DT-ST BD-RE BH10LS30 SATA Bluray
Lexmark S305 Printer/Scanner/Copier (USB)
WEI Score: 8.1/8.1/8.5/8.5/8.25
Asus Eee PC 1011PX Netbook (Windows 7 x86 Starter)
Ahhh Dwarf, I do like your suggestion. I think I will put that up to the group. I did get the batch file to work finally! But I really like just changing the registry setting. Seems cleaner and easier.

Do you know if that registry setting will hold after sysprep and cloning?

I do like Brink's Shortcut also, but that just won't solve this for the users would still have to click. Thank you for your input Brink! And I love your tutorials. Very nice.
 

My Computer

Computer Manufacturer/Model Number
Dell Optiplex GX780
OS
Win7 Enterprise 64 bit
Monitor(s) Displays
Dell 23" WideScreen
Dwarf's method is a good direct way of adding it to the registry.

The shortcut I mentioned was not to be used to be clicked on by the users, but only to used by the task to run the shortcut automatically at startup without the user having to click on anything.

Either method should work for you though. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
I did try to run the task but it came up with an error that users must have run batch locally rights or something to that degree. Operations is really locking user accounts down to the point I am sure sure what rights they will have left.
 

My Computer

Computer Manufacturer/Model Number
Dell Optiplex GX780
OS
Win7 Enterprise 64 bit
Monitor(s) Displays
Dell 23" WideScreen
Ah, ok. In that case Dwarf's method would be best in this case. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Back
Top