I am working on a simple C# project that calls for me to launch a program, pointing it at a custom configuration file. Specifically, I'm launching DOSBox with a custom config file that tells it what to do upon starting. I've used shortcuts before, and essentially this is what I put in the shortcut and it works perfectly.
"D:\Video Game Emulation\DOSBox\DOSBox.exe" "D:\Video Game Emulation\DOS Windows\GAMES\CUSTOM.CONF"
Now the program I'm writing is just a prettier way of launching a bunch of old DOS games through DOSBox, each with their own custom config. So in my button code, here's what I have.
Process.Start("D:\\Video Game Emulation\\DOSBox\\DOSBox.exe", "D:\\Video Game Emulation\\DOS Windows\\GAMES\\CUSTOM.CONF");
According to my understanding that is the proper way to start an executable and give it a custom option. However, that launches just fine, but doesn't pass in the config file properly. I also tried this.
Process.Start("D:\\Video Game Emulation\\DOSBox\\DOSBox.exe", -conf "D:\\Video Game Emulation\\DOS Windows\\GAMES\\CUSTOM.CONF");
With no luck either. Anyone know what I need to change in order for it to give DOSBox the custom configuration file properly?
Pass in the path as a string, so put your quotation marks in and test it.
Basically the reason is when checking Intellisense (spelling?), it shows an overload for Start(string fileName, string arguments).
So it wouldn't hurt to make sure you are passing strings into both.
Edit: I think I may have seen it before you edited your post. Did you have the quotation marks in the code?
OK, sorry it has taken so long to get back to this thread, but I've been quite busy. Thanks to help from dakre18, StarPilot, and Bearcat9428 I figured it out. It seems that the working directory has to be specified in the StartInfo in order for it to work. Things seem to work now. Thanks for all your help everyone!
Related
My dev team is having an issue when trying to add certain files to the ignore.conf file for PlasticSCM. When we try to add the FMODStudioCache.asset and fmod_editor.log, among other FMOD related files, to this config file, they just continue to appear in Unity when receiving pushes and readying a push locally.
It has become very annoying to deal with because it doesn't seem to work as it is intended to. See below the lines we have tried to prevent it from showing up.
**/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset
**/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset
fmod_editor.log
# Ignore the Cache folder since it is updated locally.
/[Aa]ssets/Plugins/FMOD/Cache/*
[Aa]ssets/Plugins/FMOD/Cache/*
Assets/Plugins/FMOD/Cache/*
Image link of Unity PlasticSCM with
Sorry, I don't have enough posts yet so it makes me use a link above!
Has anyone found a solution to this? We have tried to even add the files to the hidden config file too and that doesn't work either... Thanks in advance !
Edit: Spelling error in question.
I have a PDF document in the downloads folder of my solution that needs updating. I have the new file to replace it, but I am not sure how to accomplish this.
This seems like it should be straight forward, however I am not seeing an obvious solution.
Any help will be appreciated.
First off remember to not be running the application...silly me.
Check the file out. Then click on the folder and select Add-->Existing Item.
Like I said, it should be fairly straight forward. Between running the application and not checking out the file first I stumbled around.
So I have built some code, it's quite simple basically it stops all active input from keyboard and mouse until a text file of a certain name appears in the C:\Temp directory. It also has a manifest file to run it as administrator on start up.
So I found something that on the surface looks like it fulfils my needs of being able to do this task however upon running it I found out that the project has been compiled in x86 and does not run on my x64 machine. Here is the reference to the project if anyone would like to look into it, it's a very smartly designed piece of code that does an interesting objective. It also explains clearly enough what I am trying to accomplish.
So after implementing this (and failing) I have setup a couple other avenues to try, one is VBA through excel with the VBA copying itself to and from the machines in a list and running itself, then there is using VBS to write the entire code as a txt file on the target machine change the extension and then execute it remotely. I have just started researching these but I imagine the problems of running as an administrator amongst other things will crop up again to be dealt with. To be honest though I would really prefer to do this in C# only as that is the language I'm trying to go further in so I'm interested in this challenge. If anybody knows of a similar library of code or application I could look into to achieve what I'm trying I would appreciate being pointed in the right direction.
I would try and be more specific about what libraires/API's im trying to implement but the truth is I don't know what libraries I need to even interact with to get what I want. My goal is to have C# executable code on my machine and a tool that can run that executable on another machine.
Thanks
Thanks to the help in comments from #Nick.McDermaid I was able to correctly open and build the project I was trying to download. Unsure what caused the issue previously with me not being able to open and interact with the code but now I have it I shall pursue this avenue further to accomplish my goal.
As an addendum one other avenue I tried for executing code remotely was through VBS where I used
set svcproc=getobject("winmgmts:{impersonationLevel=impersonate}!\\"&MachineName & "\root\cimv2:win32_process")
scmd="""C:\Program Files\Internet Explorer\iexplore.exe"" -framemerging ""https://gifyu.com/images/Boo-Ghost-Gif.gif"""
'scmd="C:\Windows\notepad.exe"
iret=svcproc.create(scmd,null,null,pid)
set svcproc=nothing
to execute something that existed on the remote machine but I ran into a LOT of security policy issues where I could launch the process but I couldn't bring it to the foreground as the Malware tracker on the machine thought it was an attack and quashed it immediately.
Calling the new
var result = await CurrentAppSimulator.RequestProductPurchaseAsync("id");
doesn't work in Windows 8.1?
But when I call await CurrentAppSimulator.RequestProductPurchaseAsync("id", false); it does work though this method is depreciated and I need the result for consumable In-Apps.
Also by "doesn't work" I mean nothing happens. It doesn't bring up the testing popup windows for "CurrentAppSimulator" and just fails.
My test product ID was just not set right... silly me.
Couple of suggestions: Run the app once calling any method on CurrentAppSimulator. Close your app and look at the WindowsStoreProxy.XML file that the simulator creates in your app folder C:\Users\\AppData\Local\Packages\\LocalState\Microsoft\Windows Store\ApiData\WindowsStoreProxy.xml.
This file is created in UTF-16 format. If you take this file and edit it you will have better luck than if you try to create your own file.
http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.store.currentappsimulator has more details.
Last tip is to remember that this file is never written to. you have to edit it to setup each scenario.
And you'll also have better luck if you create and deploy your own copy for testing.
For me, the file would load but no functions worked when I had it save just a plain ascii file or even after changing it to UTF-8. Had to be saved as UTF-16 to work end-to-end. It would have been nice if the simulator had given some feedback on the ReloadAsync call to save me hours of pain and frustration.
I am a junior at university and quite new to the .NET framework.
Currently at my work in IT, there is a certain process in which an employee checks a MS office file, opens x applications, one after the other, and copies y files and waits on z conditions, one by one.
This process is quite long and tedious and very prone to human error. As such, I was wondering if .NET allows for some application to script this given sample procedure:
open a program,
input a string argument from an excel file,
get the output of the program,
paste the output of the program into another program,
get the output of the 2nd program,
open the output as a folder,
etc
The user should do as little work as possible (supplying some file paths and log-in credentials once and pressing some Start button).
If so, if someone could recommend a few good libraries/API to look at, it would be much appreciated.
Thank you for your time.
edit 1: System.Diagnostic.Process seems to not handle argument passing very well
Try using Powershell, it is much better suited to what you are trying to do. Good place to start:
http://technet.microsoft.com/en-us/library/ee221102
I think you could do that more easily with AutoIt.
.NET/c# isn't really suited for that task as others have already pointed out.