Go Back   Tech Support Forum > The IT Pro > Programming


Need to create a shortcut for a MS DOS command line

This is a discussion on Need to create a shortcut for a MS DOS command line within the Programming forums, part of the Tech Support Forum category. Hello everybody, I need your help to create a shortcut for a MS DOS command line. There are some steps


Reply
 
Thread Tools Search this Thread
Old 10-21-2016, 10:44 AM   #1
Registered Member
 
Join Date: Oct 2016
Posts: 7
OS: Windows 7



Hello everybody,

I need your help to create a shortcut for a MS DOS command line.

There are some steps that I launch manually and I would like them to be simpler.

Here are the steps that I want to turn into a simple shortcut:

1) I go into a directory (C:\Server) with the Windows explorer.

2) I launch a cmd on it (click on the path bar and type cmd then press enter; it launches a cmd with the right working directory).

3) I then type "java -jar HaxServer.jar"; and that's it.

What I want to do, is to create a shortcut that launches directly this line in the correct working directory.

I want to tell Windows "Please perform this line "java -jar HaxServer.jar" in this working directory "C:\Server" using cmd.

Could you please help me to create this shortcut.
OrionExpress is offline   Reply With Quote
Sponsored Links
Advertisement
 
Old 11-12-2016, 08:28 AM   #2
Registered Member
 
Join Date: Nov 2016
Location: Gilbert, AZ
Posts: 19
OS: Windows 7 / ChromeOS



Sounds like you need to make a batch file to automate that routine. Here is a tutorial on how to make batch files:

How To Write A Simple Batch (.bat) File

:yours would be ultra simple, yours could be as short as three lines:

cd C:\Server
java -jar HaxServer.jar
exit
GilbertComputer is offline   Reply With Quote
Old 11-13-2016, 04:06 PM   #3
Registered Member
 
Join Date: Oct 2016
Posts: 7
OS: Windows 7



@GilbertComputer: Thank you very much for the batch.

It worked just fine.

I found another way to do it; the shortcut way.

Create a new shortcut and fill in with this:

%windir%\System32\cmd.exe /k java -jar HaxServer.jar

Then right-click on the shortcut -> Properties -> Working Directory; and fill in with the the right working directory.

Regards.
OrionExpress is offline   Reply With Quote
Old 11-14-2016, 06:26 AM   #4
Registered Member
 
Join Date: Nov 2016
Location: Gilbert, AZ
Posts: 19
OS: Windows 7 / ChromeOS



Good job, there always are several ways to tackle most issues.
GilbertComputer is offline   Reply With Quote
Old 11-14-2016, 06:49 AM   #5
Hardware Tech Team
Networking Team |Tech
 
SpywareDr's Avatar
 
Join Date: Jun 2013
Location: Maryland, USA
Posts: 3,474
OS: W10P32, W8P32; W7U64; W7P64; XPP32; Zorin; Slax; Ubuntu; Kali (BackTrack); Android 4.4.2



FWIW - If "java.exe" and "haxserver.jar" both exist in "c:\Server", you may be able to use the following single command line:
%windir%\system32\cmd.exe /k c:\server\java.exe -jar c:\server\haxServer.jar


IOW, your simply specifying where each file is located within the command line.
__________________
Doc - Microsoft > Safety & Security Center


SpywareDr is offline   Reply With Quote
Old 11-14-2016, 10:12 AM   #6
Registered Member
 
Join Date: Oct 2016
Posts: 7
OS: Windows 7



@ SpywareDr: Thank you very much, it works just fine by specifiyng the path to all the files.
OrionExpress is offline   Reply With Quote
Old 11-14-2016, 11:10 AM   #7
Hardware Tech Team
Networking Team |Tech
 
SpywareDr's Avatar
 
Join Date: Jun 2013
Location: Maryland, USA
Posts: 3,474
OS: W10P32, W8P32; W7U64; W7P64; XPP32; Zorin; Slax; Ubuntu; Kali (BackTrack); Android 4.4.2



You're welcome.
__________________
Doc - Microsoft > Safety & Security Center


SpywareDr is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Ability to create desktop shortcut has disappeared
Ability to create desktop shortcut has disappeared, or did I never actually have it? Recently migrated to a Win7 Pro machine at work. I'm used to being able to right click anywhere and create a shortcut, but I am now reduced to copying and editing existing shortcuts. Can anybody help me get my...
Mid_Life_Crisis Windows 7 , Windows Vista Support 1 07-21-2011 09:14 AM
HELP - create shortcut error
If i right click to create a shortcut it will not allow me to ANYWHERE on my computer. I know there are ways around this but I need the error fixed. It seems like a simple permissions problem but I am struggling - HELP. If I run it my computer in safe mode the problem no longer occurs. If I...
skeet23 Windows 7 , Windows Vista Support 14 07-17-2011 06:21 AM
how create dos application ??
normal program(application) how create dos application ?? windows-based applications How create dos-based ?
dang_boy Windows XP Support 2 06-05-2011 11:09 AM
burn process failed ! Nero Vision 4
I am new to using Nero and burning DVD's so I really need help with this. Everytime I try to burn a DVD it gets about 80% done and than I get a message saying, "Burn Process Failed. An error log file was created that can be very helpful in diagnosing problems." My computer is Windows Vista and my...
kathern.otter Other Hardware Support 4 04-02-2011 07:34 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2


All times are GMT -7. The time now is 05:03 AM.


vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Copyright 2001 - 2015, Tech Support Forum

Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts

 

Partially Powered By Products Found At Lampwrights.com