Jump to content

AutoRun Files

Go to solution Solved by Opcode,

Trying to make a tech fix it usb for myself. what i want it to do is, you'll click one file bat or cmd. it'll open up, once it opens it'll give you a list of option that you would want to pick. like press 1 to trouble shoot window update or press 2 run this program or press 3 for mem diagnostic. the only code i'm missing is on how to make it give you multiple options, i can only make mine boot one file.

You mean something like this?

@[member=Echo] offtitle PC Fix-It USB:menuclsecho --------------------------------------------------------------------------------echo PC Fix-It USBecho --------------------------------------------------------------------------------echo.echo Select A Toolecho =============echo.echo [1] Option 1echo [2] Option 2echo [3] Option 3echo [4] Option 4echo [5] Exitecho.set /p op=Run:if %op%==1 goto 1if %op%==2 goto 2if %op%==3 goto 3if %op%==4 goto 4if %op%==5 goto exitgoto error:1clsecho --------------------------------------------------------------------------------echo Option 1echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:2clsecho --------------------------------------------------------------------------------echo Option 2echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:3clsecho --------------------------------------------------------------------------------echo Option 3echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:4clsecho --------------------------------------------------------------------------------echo Option 4echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:exitclsecho PC Fix-It USBexit /b

Tho keep in mind I don't batch is enough to run all of that. You will need to use 3rd party software that supports command line input or write your own.

Hey guys, wondering if anyone here knows the code on how to make an auto run file. It would open CMD and from there you can give it a list like select 1, 2, 3...etc each one will either go to a new option selection or open a file. I've only managed to find guide to open one file, trying to make a auto usb fix stick.

Link to comment
https://linustechtips.com/topic/244361-autorun-files/
Share on other sites

Link to post
Share on other sites

OPEN =

The OPEN command specifies the path and file name of the application that AutoRun launches when a user inserts a disc in the drive. You can also specify parameters/arguments to the application.
 
ICON =

The ICON command specifies an icon which represents the AutoRun-enabled drive in the Windows user interface. The icon is normally an .ico file, but can also be a .bmp, .exe or .dll file containing icon information. The icon file must be located in the same directory as the file specified by the OPEN command.
 
LABEL =

The LABEL command specifies a text label which represents the AutoRun-enabled drive in the Windows user interface. This text label is for example shown to the right or below the drive icon in Windows Explorer. The text label should be no longer than 32 characters. If the text label contains more than 32 characters, all characters after the 32nd will be truncated and not displayed.
 
SHELLEXECUTE =

The SHELLEXECUTE command opens a document or starts an application. Mostly used to open documents automatically. If this command is used with a document, an associated program that can open the document will be automatically run. This command requires Windows ME/2000 or newer.
 
SHELL =

The SHELL command specifies a default command for the drive's shortcut menu. The shortcut menu of the drive is the menu that is opened when the user right clicks on the drive icon. 
 
SHELL\VERB =

The SHELL\VERB command adds a custom command to the drive's shortcut menu. This custom command can for example be used to launch an application on the CD/DVD.
 
ACTION =

ACTION is a command that was introduced with Windows XP SP2. It is not supported in Windows before that. This command specifies a text that should be shown as the first option in the Windows Autoplay dialog, together with the icon specified by the ICON. This option is always selected by default and if the user accepts the option, the application specified by the OPEN or SHELLEXECUTE entry in the media's Autorun.inf file is launched. As an alternative, theSHELLEXECUTE command can also specify a document instead of an application.

Thats that. If you need to get in touch chances are you can find someone that knows me that can get in touch.

Link to comment
https://linustechtips.com/topic/244361-autorun-files/#findComment-3352874
Share on other sites

Link to post
Share on other sites

Use batch. There are plenty of sites that can help you learn batch, like this or this. If you want something more advanced, you can write a console-based program in one of the .NET languages.

 

Batch is not the issue. It's the fact that batch does not always do multiple programs. 

5800X3D - RTX 4070 - 2K @ 165Hz

 

Link to comment
https://linustechtips.com/topic/244361-autorun-files/#findComment-3353017
Share on other sites

Link to post
Share on other sites

Use batch. There are plenty of sites that can help you learn batch, like this or this. If you want something more advanced, you can write a console-based program in one of the .NET languages.

thanks ill give it a try, was hoping if there was just one or two simple code line you have to add.

Link to comment
https://linustechtips.com/topic/244361-autorun-files/#findComment-3353158
Share on other sites

Link to post
Share on other sites

thanks ill give it a try, was hoping if there was just one or two simple code line you have to add.

I could write some code, but batch isn't a language I do too well. I honestly hate the damn thing, but it's good for beginners and it's simple as hell.

I might be wrong.

Link to comment
https://linustechtips.com/topic/244361-autorun-files/#findComment-3353179
Share on other sites

Link to post
Share on other sites

What are you trying to do exactly? Your original post is not that informative of what you're trying to accomplish.

 

P.S. 1337 post.

Trying to make a tech fix it usb for myself. what i want it to do is, you'll click one file bat or cmd. it'll open up, once it opens it'll give you a list of option that you would want to pick. like press 1 to trouble shoot window update or press 2 run this program or press 3 for mem diagnostic. the only code i'm missing is on how to make it give you multiple options, i can only make mine boot one file.

Link to comment
https://linustechtips.com/topic/244361-autorun-files/#findComment-3354959
Share on other sites

Link to post
Share on other sites

What are you trying to do exactly? Your original post is not that informative of what you're trying to accomplish.

 

P.S. 1337 post.

SHort story short. its like when you go to cmd and you're trying to format or make a bootable usb. when you type in the code list disk, it'll give you all the storage device and from there you can select different option. same thing.

Link to comment
https://linustechtips.com/topic/244361-autorun-files/#findComment-3354960
Share on other sites

Link to post
Share on other sites

Trying to make a tech fix it usb for myself. what i want it to do is, you'll click one file bat or cmd. it'll open up, once it opens it'll give you a list of option that you would want to pick. like press 1 to trouble shoot window update or press 2 run this program or press 3 for mem diagnostic. the only code i'm missing is on how to make it give you multiple options, i can only make mine boot one file.

You mean something like this?

@[member=Echo] offtitle PC Fix-It USB:menuclsecho --------------------------------------------------------------------------------echo PC Fix-It USBecho --------------------------------------------------------------------------------echo.echo Select A Toolecho =============echo.echo [1] Option 1echo [2] Option 2echo [3] Option 3echo [4] Option 4echo [5] Exitecho.set /p op=Run:if %op%==1 goto 1if %op%==2 goto 2if %op%==3 goto 3if %op%==4 goto 4if %op%==5 goto exitgoto error:1clsecho --------------------------------------------------------------------------------echo Option 1echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:2clsecho --------------------------------------------------------------------------------echo Option 2echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:3clsecho --------------------------------------------------------------------------------echo Option 3echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:4clsecho --------------------------------------------------------------------------------echo Option 4echo --------------------------------------------------------------------------------# Do Your Code Heregoto menu:exitclsecho PC Fix-It USBexit /b

Tho keep in mind I don't batch is enough to run all of that. You will need to use 3rd party software that supports command line input or write your own.

Link to comment
https://linustechtips.com/topic/244361-autorun-files/#findComment-3355102
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×