Execute Batch file on Windows 7 Remotly? - windows

How can i launch a batch file on Windows 7 in a network environment remotely. I have admin rights on the system. Can someone please give me some idea?

Serverfault is probably better place for this question but in any case, you can use psexec from sysinternals.
Here is the link for that executable.
http://technet.microsoft.com/en-us/sysinternals/bb897553

Related

command to view user rights and the owner of a file or document via windows cmd

I have got a novell file share and I am wanting to find out the permissions of the fileshare in the windows cmd. I was just wondering what commands I can use to do this?
SYS:PUBLIC\RIGHTS.EXE
Available on any server Novell, OES or Netware - it does not matter.

How to invoke a remote vbs file from local machine?

I have copied a .vbs file to a remote machine which inturn invokes a local application.
Please suggest a way to invoke the remote vbs from the local machine.
I tried with wmi. I need to have UI
I know that this is an old post, but based on what you're saying, psexec from PsTools should do the trick.
You would use it in the following format:
psexec \\remote -u remoteuser -p password c:\scripts\script.vbs
For full information on psexec, see this TechNet article.

How to run Hadoop on Cygwin with proper credentials to enable setting file permissions, etc.?

I cannot change the permissions on files when I run Hadoop in Cygwin:
java.io.IOException: Failed to set permissions of path: \tmp\hadoop-James\mapred\staging\James-1143336710\.staging to 0700
From what I've gathered you can't really run Cygwin as root since Windows doesn't really have a notion of root (reference), and I've tried to run Cygwin as the Administrator user but this option isn't available to me when I right click on the Cygwin shortcut in Windows XP (I've also tried changing the Cygwin shortcut's properties to allow me to run as another user but that option is disabled).
Can anyone advise me as to how I can get past this issue? Thanks in advance for your help.
Here is a simple-to-use workaround for this particular problem:
https://github.com/congainc/patch-hadoop_7682-1.0.x-win
This issue is not about file permissions per se. Rather, it is an issue with the Java VM's support for setting file permissions on Windows, and an intransigent attitude among the Hadoop committers not to work around the problem. See HADOOP-7682 for the gory details:
https://issues.apache.org/jira/browse/HADOOP-7682
run ssh-host-config. it will set up the prvileged user "cyg_server" and set up sshd
as a windows service.
in "/etc/passwd" give the user a home "/home/cyg_server" and shell "/bin/bash".
create a password for the user. then create the ssh keys and add them to
~/.ssh/authorized_keys.
start the windows service. in a cygwin shell, "ssh cyg_server#localhost".
--- edit ---
forgot to mention: when you create the password for the cyg_server user, you need a root cygwin shell (run cygwin bash as Administrator). also give the user a valid shell (/bin/bash).

Permissions Elevation for Windows 7?

Ive got a java app which needs to execute a driver installer exe file. On Linux we type "gksudo myCommand". Is there a way to elevate permissions from Windows command line?
You may run every application in windows with a different user e.g. Administrator. But the user who executes this command needs to have the credentials to do so.
Edit.:
In advance you can lookup the User Account Control (UAC) which is available in Windows 7 and Vista if it is possibly an alternative for you.
I decided to deploy an executable binary onto the system which calls the jar. This way the user can right click and run as administrator... That didn't work... SO I kept looking... Check this out..
Elevate.exe.. It's basically like Windows GKSudo!!!!
http://www.robotronic.de/elevate.html
So... I packaged the 32bit exe into my program and deploy it, then run it as necessary.
You can use runas command like runas /user:Administrator myCommand (it requires the users to type password).
You can also use Start-Process cmdlet like Start-Process -Verb runas myCommand in PowerShell (it requires the users to click the UAC dialog).
see: http://satob.hatenablog.com/entry/2017/06/17/013217

Why can't Perl launch telnet under Windows?

I had enabled telnet client feature on Windows 2008, and tried to launch it from a Perl script:
perl -e "system('c:\windows\system32\telnet localhost')"
Then I got an error like this:
'c:\windows\system32\telnet' is not recognized as an internal or external command,
operable program or batch file.
I could run it from 'cmd' terminal, or, if I copy the telnet.exe to local dir, it could be launched. I examined the permissions of telnet.exe under c:\windows\system32, no special finding.
Could anybody help me on this case? Thanks a lot!
I ran into the exact same problem recently, trying to launch telnet and the rdp client programmatically. The problem is related to an aspect of windows "design" called file system redirection:
"Windows on Windows 64-bit (WOW64) provides file system redirection. In a 64-bit version of Windows Server 2003 or of Windows XP, the %WinDir%\System32 folder is reserved for 64-bit applications. When a 32-bit application tries to access the System32 folder, access is redirected to the following folder: %WinDir%\SysWOW64. By default, file system redirection is enabled."
http://www.codeproject.com/tips/55290/Disabling-Windows-file-system-redirection-on-a-CFi.aspx
I think you have to specify the full name of the program, that is telnet.exe. But you'd be better off using Net::Telnet module or something like Expect.pm that handles interactive sessions programmatically.
hi you are using Perl, so i was wondering why you don't use Net::Telnet, instead of the telnet.exe of windows, which AFAIK is not friendly for programming.
On my computer following code works (Windows 7):
$telnet = $ENV{'WINDIR'} . '\system32\telnet.exe';
system("$telnet 192.168.1.1");
It must be either a) permissions b) incorrect path, c) you need .exe at the end or d) you need to capitalise the "c:"
You might want to verify under what account Perl execute and check if that account has permissions to run executables like telnet.
Just to verify the theory, I'd run Perl under a high privileged account (like admin) to check if it runs telnet and then tweak the account it is running under.
Hope this helps!
Read about console host.
ConHost represents a permanent change in the way that console application I/O is handled.
See also a related post on SysInternals forums.
I do not have access to any Windows Server 2008 machines right now, so I cannot test this, but can you check what happens when you run wperl -e "system('c:\windows\system32\telnet localhost')" from the equivalent of Start -> Run on that OS.
The answer is: using sysnative instead of system32, because the 32-bits application is not allowed to have access to the system32 directory (64-bit application). By using this alias sysnative it wil work.

Resources