Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File

Status
Not open for further replies.

GrimR

IS-IT--Management
Jun 17, 2007
1,149
0
0
ZA
How can I get a batch file to run in Windows 10, when I double click it, it takes each line as a seperate command, if you hold down shift all you get is powershell which does the same thing.


MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
I can't understand what you're asking. Each line is a separate command. A batch file just groups a sequence of separate commands in a specified order. For instance
Code:
echo Do this now
set x=10
echo x is %x%
pause
If you run that, you will get something like
Code:
C:\Users\CUP\Documents>echo Do this now
Do this now
C:\Users\CUP\Documents>set x=10
C:\Users\CUP\Documents>echo x is 10
x is 10
C:\Users\CUP\Documents>pause
Press any key to continue . . .
If you add and @echo off in front then you will get something like
Code:
Do this now
x is 10
Press any key to continue . .
Which may not look like it is executing each line as a separate command but it is: the echo is off so you are not seeing the echo of each command.
 
OK so that clears that up, thanks, but for some reason Win10 just doesnt seem to process the commands as in Win7 and before.
It just seems to have too much security

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Yes, security gets heightened with every OS release. If they don't act on it, some irresponsible reporter is going to pick on it and then every hacker in the world will attempt exploiting it.

Which commands didn't work as they did on W7?
 
Mostly commands with switches in

e.g msiexec /i "Agent-6.11.1-x64.msi" /quiet Agent_GROUPS="NameHere" AGENT_SERVER=server.com:443 Agent_KEY=92849238474832748237482
e.g PsExec64.exe -accepteula -u "Patch" -p "P@55w0rd" Installer.exe

MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top