Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

batch file help

Oct 31, 2011 12:44AM PDT

I am trying to create a batch file that will start an executable any examples will be greatly appreciated

Discussion is locked

- Collapse -
Re: batchfile
Oct 31, 2011 12:52AM PDT

If you can do it in the command prompt, you can do it in the batch file also. That's the same.

The 3 common ways:
1. Just type the filename (like winword or notepad) if the folder is included in the current path, followed by all parameters you need
2. Type the full path (= full filename starting with the driveletter or share) followed by all parameters you need
3. Use the start command with a parameter like /wait. Typing start /? in the command prompt tells all.

Since you don't ask about doing it in the command prompt, this is all I'm telling now. And even that is much more than you ask. The short version would only have included the first line.

Kees

- Collapse -
batch file help
Oct 31, 2011 2:09AM PDT

I need a script that I can place on devices that will start the program automatically when the device is started this is what I have but it only opens a command prompt window and then closes.

@echo off
"C:\Program Files (x86)\SonicWALL Global VPN Client\SWGVC.exe

- Collapse -
Re: batchfile
Oct 31, 2011 2:17AM PDT

I see only one quote. Should be two (add one at the end).

And batch files are never started automatically. Why not use an autorun.inf? But please realise that current versions of Windows don't run autorun.inf automatically for security reasons. Too much malware distributed that way.

Kees

- Collapse -
What "devices" are you needing this batch file to run on?
Nov 3, 2011 11:05AM PDT

On a Windows computer you can add the batch file to the Startup directory and it will execute upon getting booted up.

On a Windows machine you could also add it to the registry at this key -
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

- Collapse -
batch file response
Nov 3, 2011 10:06PM PDT

I am running a vpn client I got it to run when I click the file but I can get it to run at start up? Nice! what do I need to add to the script after Run? The location or something else?

- Collapse -
Re: batch file
Nov 3, 2011 10:11PM PDT

No need to use a batchfile for that. Just make a shortcut to the exe-file you want to run and copy that to the Startup folder.

Why didn't you tell that in your first post? That would have made this whole discussion about batchfiles unnecessary.

Kees

- Collapse -
well what about a proxy server?
Oct 31, 2011 4:33AM PDT

Ok well I just wasted two weeks Sad I also was looking at using a proxy server which I installed on our virtual server but Im not sure how to use it I am embarrassed and ashamed but its the truth do you have any experience with these? it is safe squid proxy server I am trying to allow our service techs out in the field to access an intranet site in our network using our active directory to filter access

- Collapse -
Why not ...
Oct 31, 2011 5:03AM PDT

- ask your boss to hire a capable professional with the right experience to set this up and educate you?
- ask your boss to send you on a few system management courses (on his costs, of course)

Kees

- Collapse -
in response
Oct 31, 2011 9:24AM PDT

I will figure it out thanks if you don't know thats ok Wink you can go back to your world of warcraft tournament lol! what a waste of time grow up and realize that people working together is the only way to succeed you are obviously a lower level worker with delusions of grandeur and a soldering iron get over yourself Cool