Running a *.BAT File at start up using a shortcut
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Running a *.BAT File at start up using a shortcut
I can create a shortcuts on my desktop by Right Clicking>New>Shortcut with no problem. In trying to make a bat file run at start up I ran into how to create a shortcut and it said to Right Click a blank space on the Windows desktop, a folder, or in a directory. Choose New then select Shortcut. This only works for me on the Desktop. Why wouldn’t I be able to create shortcuts in all the locations the article I read says? The only option available after choosing "New" is to create a new folder in all the locations other then the desktop.
Regards,
hlewton
hlewton
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Running a *.BAT File at start up using a shortcut
This is what I see when I click an empty part of a folder - I'm using Windows 11, so it looks slightly different, but the New > Shortcut option should be there in Windows 10 too. Make sure that you do not right-click on a file or subfolder, but in an empty spot.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Re: Running a *.BAT File at start up using a shortcut
OK, I have never before done that. I see what you're saying but the only empty spots I see are to the left of the file names. I assume that is where I should be. I can't click on the folder itself, which is what I assumed I was supposed to do.
Thanks.
Thanks.
Regards,
hlewton
hlewton
-
- Administrator
- Posts: 12623
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Running a *.BAT File at start up using a shortcut
Depending on the view you have selected, there is plenty of white space to the right of the explorer window where you can right-click - or you can click below all the files
StuartR
-
- PlutoniumLounger
- Posts: 15645
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: Running a *.BAT File at start up using a shortcut
The extravagantly large image shows by an arrow where I right-clicked to obtain "New" and "Shortcut".
I temporarily created the white space by narrowing the details columns, as shown by my markings along the column headings.
I hope that this helps!
Tip: I no longer use "AutoExec.bat" as my filename. My current boot sequence is "Auto20211028.bat, and in that way i can presevre an audit trail of versions of the critical boot sequence.
Tip: My auto batch file includes:-
Code: Select all
::
:: Make a backup copy of the latest use of this batch file.
::
COPY %0 T:\BatLap
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
He who plants a seed, plants life.
-
- Administrator
- Posts: 7216
- Joined: 15 Jan 2010, 22:52
- Location: Middle of England
Re: Running a *.BAT File at start up using a shortcut
I'm not quite understanding what you want - are you trying to create the BATch file, or the shortcut to the BATch file?
If the second, try right-clicking on the BATch file, and select 'Create shortcut'. Once created, just drag the shortcut to wherever you want it.
Leif
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Re: Running a *.BAT File at start up using a shortcut
Yep, I see it now. I never thought to go all the way to the right. Thanks for that.ChrisGreaves wrote: ↑17 Nov 2021, 15:48The extravagantly large image shows by an arrow where I right-clicked to obtain "New" and "Shortcut".
I temporarily created the white space by narrowing the details columns, as shown by my markings along the column headings.
I hope that this helps!
Tip: I no longer use "AutoExec.bat" as my filename. My current boot sequence is "Auto20211028.bat, and in that way i can presevre an audit trail of versions of the critical boot sequence.
Tip: My auto batch file includes:-so that the boot sequence makes a copy of itself (at boot time) to my data drive. That way I can exsperiment with the copy on drive T without corrupting the current working copy in "C:\Users\Chris075\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup".Code: Select all
:: :: Make a backup copy of the latest use of this batch file. :: COPY %0 T:\BatLap
Cheers
Chris
I am going to try to explain what I want to do in my following post.
Regards,
hlewton
hlewton
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Re: Running a *.BAT File at start up using a shortcut
I have one computer that is not always showing up in the Network option in Windows File Explorer on my other computers. Quite some time ago I created a bat file to stop and then Start the Function Discovery Resource Publication on that computer. That bat file is on the Desktop. It makes that computer show up after manually running that bat file. I have tried all the recommended settings for the Function Discovery Resource Publication in Windows Services and nothing makes it work correctly except the bat file. So I thought I would try having the computer run it at Startup by putting a copy of the Desktop shortcut in Windows 10 All Users Startup folder. If I copy that shortcut to that folder do you think that would work?
Regards,
hlewton
hlewton
-
- Administrator
- Posts: 78595
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- Administrator
- Posts: 12623
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Running a *.BAT File at start up using a shortcut
I did something very similar. I created a BAT file that stopped and restarted FDResPub
I use task scheduler to run this, with admin privileges, each time I log in
I use task scheduler to run this, with admin privileges, each time I log in
StuartR
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Re: Running a *.BAT File at start up using a shortcut
I am not at all sure how to do that. I found and opened Task Scheduler but from there I don't know what to do.
What I see is in the attachment. Would go to the Actions section, create a task and paste the same thing that is inside my bat file? Then I assume it will ask me when I want to run it and if Admin privileges should be given to it. Is this sorrect?
You do not have the required permissions to view the files attached to this post.
Regards,
hlewton
hlewton
-
- Administrator
- Posts: 12623
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Running a *.BAT File at start up using a shortcut
Click Create task, you will see this form, with five tabs.
On the Triggers tab, click new, then Begin the task "At log on", any user (or at Startup if that is what you want)
On the Actions tab, click new, then "Start a program", and browse to your bat file.
OK your way out of all the boxes and you should be all set
On the general tab, give your scheduled task a nameOn the Triggers tab, click new, then Begin the task "At log on", any user (or at Startup if that is what you want)
On the Actions tab, click new, then "Start a program", and browse to your bat file.
OK your way out of all the boxes and you should be all set
You do not have the required permissions to view the files attached to this post.
StuartR
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Re: Running a *.BAT File at start up using a shortcut
Thank you very much. I am going to give it a try right now.StuartR wrote: ↑18 Nov 2021, 08:19Click Create task, you will see this form, with five tabs.
General.png
On the general tab, give your scheduled task a name
On the Triggers tab, click new, then Begin the task "At log on", any user (or at Startup if that is what you want)
On the Actions tab, click new, then "Start a program", and browse to your bat file.
OK your way out of all the boxes and you should be all set
Regards,
hlewton
hlewton
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Re: Running a *.BAT File at start up using a shortcut
Well I did it all but it would not allow me to create the task without assigning a password. I don't use passwords. Is there a way around that? If I have to use a password does it ask for it as the computer is booting up? Sorry but I have never used a password for my computers and I think adding one now would mess up my connections to my other computers ability to access that particular computer.StuartR wrote: ↑18 Nov 2021, 08:19Click Create task, you will see this form, with five tabs.
General.png
On the general tab, give your scheduled task a name
On the Triggers tab, click new, then Begin the task "At log on", any user (or at Startup if that is what you want)
On the Actions tab, click new, then "Start a program", and browse to your bat file.
OK your way out of all the boxes and you should be all set
Regards,
hlewton
hlewton
-
- Administrator
- Posts: 12623
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Running a *.BAT File at start up using a shortcut
You can't do this if you don't use passwords
StuartR
-
- PlatinumLounger
- Posts: 3811
- Joined: 24 Oct 2010, 23:39
- Location: Canton, Ohio USA
Re: Running a *.BAT File at start up using a shortcut
OK, that is what I was afraid of. However, I think I have what I need. I opened the shell:common startup folder and placed the bat file in it. I watched it boot up and it opened the command window and ran it as usual. The only thing different was when it got to the last command in the bat file - net start "Function Discovery Resource Publication" it made the command window huge but it did close. This doesn't happen when run manually, but I believe it worked. I can see that computer on other computers, at least today I can. We'll see what tomorrow brings.
Thanks for your help.
Regards,
hlewton
hlewton