Is it possible to change the IP address and Device Name in Windows CE via CMD or Batch? - batch-file

Ideally, I'd have a batch file on my desktop that I could click to quickly change these configurations, but the batch scripting tutorials I've been looking at don't seem to work for Windows CE. Anyone know how to do this?
I want to set a static IP, Subnet Mask, Default Gateway, and Device Name.

If you want an easy and fast way (as double clicking a bat) to change your network configuration, typically you'll need to write a tool.
The tool must:
change values in the registry for your network adapter; the registry entries are something like:
[HKEY_LOCAL_MACHINE\Comm\NETADAPTER\Parms\TcpIp]
"IpAddress"="192.168.0.100"
"DefaultGateway"="192.168.0.1"
"Subnetmask"="255.255.255.0"
ask the adapter to renew his address (you can use NDISConfig.exe to do this)
If you have an hive based registry (data in registry are stored permanently and will be there after a reboot) you can reboot the device to easily implement the second step.
Hope this is helpful

Related

How to transfer a file from Windows XP to a virtual machine inside vSphere 5.5?

I have a file on my desktop that I need to put onto one of the virtual machines, however when I search for solutions on how to do this many say to download third party software to do it, or to use drag and drop through vSphere. The issue is I am on a restricted network and can't install additional software, and also don't have the drag an drop functionality in vSphere.
I have seen it done in the past using the command line and the IP address of the machine I want to send it to, along with the username and password, however I can't remember the syntax. Can anyone provide instruction on what to type into the terminal to do this?
Have you given the Copy-VMGuestFile cmdlet a look from PowerCLI?
http://www.vmware.com/support/developer/PowerCLI/PowerCLI651/html/Copy-VMGuestFile.html
If you're not a fan of PowerShell, there's a couple SDK options you could use with the vSphere Web Services API. Specifically, you're looking for the GuestFileManager object and the InitiateFileTransferToGuest method: http://pubs.vmware.com/vsphere-5-5/topic/com.vmware.wssdk.apiref.doc/vim.vm.guest.FileManager.html

Remote Desktop Application - Start multiple sessions on my client PC

I have a windows 2016 server running RDS. It is configured to run a single application when a user accesses it from a .rdp shortcut. The user just sees the application as though it is running on their local machine, not a whole remote desktop.
If from a client PC, if I launch the application and log in then I can see a new connection in the RD Gateway manager.
However if I launch the application from the same client PC multiple times I am only asked to login the first time, and whilst I see many instances of the application I only see one connection in the RD gateway manager.
I would like a new connection each time I launch the application, so that I can simulate multiple users running the app concurrently in their own sessions.
I have tried adding "prompt for credentials on client:i:1" to the .rdp shortcut and this has no effect.
Thanks you your help.
I don't think it's possible. Let me try to explain:
Whenever you launch the RDP file, you connect to a session on the RDSH. Now, if you want separate connections, that means that there should be multiple sessions (probably for the same user since the credentials don't change) which is not allowed by the RDSH by default.
Assuming you get passed multiple sessions for same user, MSTSC actually recognizes that for the given RDP file, there is already an open connection, so it will try to reuse that.
Last but not least, there is the problem of licensing - you are "working around" the system: both per-device and per-user licensing would report 1, therefore it would probably be a violation of ToS.
It would be much more useful if you could tell us what you are trying to achieve and then maybe we can help you more.
P.S.: This question has nothing to do with programming, so it probably belongs to https://superuser.com
Hi I figured out a solution to this, so I will share in case it is useful for anyone else.
Modify the hosts file to include different names for the target machine ip address:
eg:
51.xxx.159.233 test1.xxx.uk-user1
51.xxx.159.233 test1.xxx.uk-user2
51.xxx.159.233 test1.xxx.uk-user3
51.xxx.159.233 test1.xxx.uk-user4
Then in each rdp launch shortcut, reference a different alias.
eg:
Shortcut1:
full address:s:test1.xxx.uk-user4
Shortcut2:
full address:s:test1.xxx.uk-user3
Then when the RDP is launched it will ask you to log in even if you already have an active connection and server will have a new user logged into it.
Hope this helps somone in the future.

List connected peripheral devices

I'm working on Windows 10 and I'm looking for a batch script command to get a list of all peripheral devices that are in my pc.
Does anyone know the command I'm looking for?
WMIC will give some spiffy info (I use it to inventory my company's PCs), but it won't list ALL installed devices. For that, you'll have to check the registry. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum is probably the key/branch you're looking for, and you can use the REG command to query it, but you'll still need to loop through a bunch of keys and decide how much information your REALLY want. For example, do you really want to know about virtual devices like "Microsoft Wi-Fi Direct Virtual Adapter" or the "Microsoft VHD Loopback Controller"? If you want to limit things to just "real" hardware, you'll STILL have to do a lot of sorting unless you really want all 2 or 4 processor cores listed (because each is its own device). You probably don't really need to know much about the System Timer device or the PIC.
If possible, you should use ANYTHING other than a command prompt batch file. Use VBScript, Powershell, or even Devcon.
Update: I just tested, and reg query hklm\system\currentcontrolset\enum /s /f "DeviceDesc" is the command you are looking for.

HSQL Embedded Database

I want to create HSQL embedded database but jdbc:hsqldb:file:"What should I write here to work on other PC". If I copy my project to another pc and click the jar file , it needs to access my database. So, what should I write for file path ? My application works on my PC but does not work on other PC because it does not access the database.
Please help me. Thank you.
If you're trying to access a file that isn't located on the same machine, you're most likely out of luck, unless you can set up a link, file sharing, etc.
If you want to make the file location configurable, then use a system parameter, a config file value, etc. and construct the JDBC string from that, e.g.,
java -jar some.jar -Ddb.location=/some/file/path
...
String url = "jdbc:jsqldb:file:" + System.getProperty("db.location");
If you want to access a DB server then you're probably going about this the wrong way.

Mapping a network drive only when connected to a Domain

I have looked around a bit, and I haven't found a solution that exactly fits my needs. I have a Laptop that I use for work, and for personal use at home. At work, we are operating on a Domain, and have several Network Storage locations that I use often. So i decided that I want to Map these drives. However, I do not want to get popup messages nor see that these drives are disconnected when I am at home, and there is no connection to these servers. Is there a built in way to accomplish this task in windows 7, or am I going to need to resort to a start up script. If I need a script, how can I check to see if the computer is connected to a Domain, and then map drives based on that option. If a script is required, I would prefer to use a .bat file. Another route that would be achievable is doing this through group policy if someone can direct me as to how to push certain mapped drives to specific users.
Without more details, I believe if value of the Windows variable USERDOMAIN is equal to the value of COMPUTERNAME then your host is not in a domain
If %USERDOMAIN% <> %COMPUTERNAME% SET indomain="y"
Alternatively, you can 'hack' it by trying to do something like a DIR of a folder like WINDOWS on a computer that's part of the domain. If you get denied then you're not part of the domain.

Resources